From smkelly@zombie.org  Sun Dec 22 22:32:32 2002
Return-Path: <smkelly@zombie.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BF1B937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Dec 2002 22:32:32 -0800 (PST)
Received: from area51.slashnet.org (area51.slashnet.org [209.150.98.86])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4B85D43EE8
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Dec 2002 22:32:32 -0800 (PST)
	(envelope-from smkelly@zombie.org)
Received: from edgemaster.zombie.org (ip68-13-64-165.om.om.cox.net [68.13.64.165])
	by area51.slashnet.org (Postfix) with ESMTP id EF6D74A358
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 23 Dec 2002 01:32:25 -0500 (EST)
Received: by edgemaster.zombie.org (Postfix, from userid 1001)
	id 6864B415F8; Mon, 23 Dec 2002 00:32:25 -0600 (CST)
Message-Id: <20021223063225.6864B415F8@edgemaster.zombie.org>
Date: Mon, 23 Dec 2002 00:32:25 -0600 (CST)
From: Sean Kelly <smkelly@zombie.org>
Reply-To: Sean Kelly <smkelly@zombie.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: read() on /dev/io locks system
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46486
>Category:       i386
>Synopsis:       read() on /dev/io locks system
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 22 22:40:00 PST 2002
>Closed-Date:    Sat Jan 11 01:32:37 PST 2003
>Last-Modified:  Sat Jan 11 01:32:37 PST 2003
>Originator:     Sean Kelly
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD edgemaster.zombie.org 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sat Dec 21 02:05:20 CST 2002 root@edgemaster.zombie.org:/usr/obj/usr/src/sys/EDGEMASTER i386


	
>Description:
	Doing a read() or write() on /dev/io will cause the system to enter
	an infinite loop with Giant locked. This is the case on RELENG_5 and
	HEAD.
	More information can be found in this thread:
	http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=1400050+0+/usr/local/www/db/text/2002/freebsd-current/20021222.freebsd-current

	And specifically: http://www.FreeBSD.org/cgi/getmsg.cgi?fetch=1424072+0+/usr/local/www/db/text/2002/freebsd-current/20021222.freebsd-current

>How-To-Repeat:
	$ su -
	# cat /dev/io
	*system hang*
>Fix:

Index: sys/i386/i386/mem.c
===================================================================
RCS file: /usr/home/ncvs/src/sys/i386/i386/mem.c,v
retrieving revision 1.99
diff -u -p -r1.99 mem.c
--- sys/i386/i386/mem.c 11 Oct 2002 14:58:28 -0000      1.99
+++ sys/i386/i386/mem.c 21 Dec 2002 07:54:29 -0000
@@ -195,6 +195,8 @@ mmrw(dev_t dev, struct uio *uio, int fla
                                return (EFAULT);
                        error = uiomove((caddr_t)(int)uio->uio_offset, (int)c, u
io);
                        continue;
+               default:
+                       return (ENODEV);
                }

                if (error)

>Release-Note:
>Audit-Trail:

From: Sean Kelly <smkelly@zombie.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: i386/46486: read() on /dev/io locks system
Date: Sat, 11 Jan 2003 01:34:20 -0600

 This PR can be closed.
 
 Fixed in sys/i386/i386/mem.c:
      RELENG_4:   1.79.2.9 (Jan 4 22:58:01 2003 UTC)
      RELENG_5_0: 1.99.2.1 (Jan 4 22:55:30 2003 UTC)
      HEAD:       1.100    (Dec 31 21:44:38 2002 UTC)
 
 -- 
 Sean Kelly         | PGP KeyID: D2E5E296
 smkelly@zombie.org | http://www.zombie.org
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Sat Jan 11 01:30:41 PST 2003 
State-Changed-Why:  
The submitter reports the issue was fixed in src/sys/i386/i386/mem.c: 

RELENG_4:   1.79.2.9 (Jan 4 22:58:01 2003 UTC) 
RELENG_5_0: 1.99.2.1 (Jan 4 22:55:30 2003 UTC) 
HEAD:       1.100    (Dec 31 21:44:38 2002 UTC) 

Thanks Sean! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46486 
>Unformatted:
