From nobody@FreeBSD.org  Thu Feb 16 11:13:00 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 312AD16A420
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2006 11:13:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 010EB43D45
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2006 11:13:00 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k1GBCxEg040805
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Feb 2006 11:12:59 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k1GBCxXh040804;
	Thu, 16 Feb 2006 11:12:59 GMT
	(envelope-from nobody)
Message-Id: <200602161112.k1GBCxXh040804@www.freebsd.org>
Date: Thu, 16 Feb 2006 11:12:59 GMT
From: Andrew Hacking <ahacking@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Applying devfs rulset fails
X-Send-Pr-Version: www-2.3

>Number:         93423
>Category:       kern
>Synopsis:       [jail] Applying devfs rulset fails
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 16 11:20:09 GMT 2006
>Closed-Date:    Sun Sep 10 09:31:33 GMT 2006
>Last-Modified:  Sun Sep 10 09:31:33 GMT 2006
>Originator:     Andrew Hacking
>Release:        6.0-RELEASE-p4
>Organization:
>Environment:
FreeBSD home.inet 6.0-RELEASE-p4 FreeBSD 6.0-RELEASE-p4 #1: Wed Feb 15 10:50:20 EST 2006     root@home.inet:/usr/obj/usr/src/sys/DELL4100  i386
>Description:
It is currently not possible (for me at least) to setup a secure jail by adding devfs rules. Also devfs commands can leave the system in a state where it is not possible to shutdown cleanly.

On attempting to setup devfs for a jail, the following devfs command fails:

# mount_devfs devfs /jail/foo/dev
# devfs -m /jail/foo/dev rule -s 4 applyset
devfs rule: ioctl DEVFSIO_SAPPLY: No such process

[Note: rule-set doesn't get applied]

Also, trying to apply rules manually hangs and never returns, leaving the process blocked in disk (D) wait state.

Shutting down the system also never completes and requires a power cycle and (at least for me) required manual fsck of most file-systems on reboot.

This could potentially be related to the problem described in:
    http://lists.freebsd.org/pipermail/freebsd-hackers/2006-January/015009.html

My revision of /usr/src/sys/fs/devfs_rule.c is:
  $FreeBSD: src/sys/fs/devfs/devfs_rule.c,v 1.14.2.2 2005/09/26 14:36:52 phk Exp $

I will try revision listed in above email and report back....

>How-To-Repeat:
# mkdir /tmp/foodev
# mount_devfs devfs /tmp/foodev
# devfs -m /tmp/foodev rule -s4 applyset
devfs rule: ioctl DEVFSIO_SAPPLY: No such process

[Note: rule-set doesn't get applied]

Now try adding rules manually to trigger process hang:
# devfs -m /tmp/foodev rule add hide
# devfs -m /tmp/foodev rule add path null unhide
.. etc ...
>Fix:
              
>Release-Note:
>Audit-Trail:

From: Andrew Hacking <ahacking@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/93423: Applying devfs rulset fails
Date: Fri, 17 Feb 2006 23:05:20 +1000

 ------=_Part_4941_14681164.1140181520695
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 Ok, built new kernel and world using RELENG_6 as of 17 Feb 2006 and ruleset
 still fails to apply reporting the same error.
 
 Any ideas ?
 
 ------=_Part_4941_14681164.1140181520695
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 Ok, built new kernel and world using RELENG_6 as of 17 Feb 2006 and ruleset=
  still fails to apply reporting the same error.<br><br>Any ideas ?<br>
 
 ------=_Part_4941_14681164.1140181520695--
State-Changed-From-To: open->feedback 
State-Changed-By: matteo 
State-Changed-When: Fri May 26 15:00:17 UTC 2006 
State-Changed-Why:  
I cannot reproduce this. Are you still having this issue? 


Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Fri May 26 15:00:17 UTC 2006 
Responsible-Changed-Why:  
Grab this as I'm interested in jail 

http://www.freebsd.org/cgi/query-pr.cgi?pr=93423 
State-Changed-From-To: feedback->closed 
State-Changed-By: matteo 
State-Changed-When: Sun Sep 10 09:31:17 UTC 2006 
State-Changed-Why:  
feedback timeout 

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