From owner-freebsd-current Fri Dec 20 0:22:58 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8777237B401 for ; Fri, 20 Dec 2002 00:22:57 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D7EF43EE6 for ; Fri, 20 Dec 2002 00:22:56 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id TAA24538; Fri, 20 Dec 2002 19:22:35 +1100 Date: Fri, 20 Dec 2002 19:24:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Sean Kelly Cc: current@FreeBSD.ORG Subject: Re: `cat /dev/io` leads to system lockup. In-Reply-To: <20021220062935.GA699@edgemaster.zombie.org> Message-ID: <20021220190007.B344-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 20 Dec 2002, Sean Kelly wrote: > On my 5.0-CURRENT kernel built 45 minutes ago, I can bring my system to its > knees by doing > > # cat /dev/io > > While I understand that this isn't exactly something one would normally be > doing, is it really something that should bring the system down? No. Writing to /dev/io is not supported. write(2) to a device that doesn't support writing should return -1 and set errno to ENODEV. This was broken mainly by removing the default case from mem.c:mmrw(). This causes mmrw() to loop endlessly without giving up control. Giant locking in -current makes this especially fatal -- mmrw() holds Giant so even most interrupt handlers are blocked. In RELENG_4 the only bug near here is that mmrw() returns ENXIO instead of ENODEV for writes to /dev/io. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message