kern/103447: "mount -o nodev" was useful for preventing escape from chroot/jail etc.

Jukka A. Ukkonen jau at iki.fi
Wed Sep 20 22:10:22 PDT 2006


>Number:         103447
>Category:       kern
>Synopsis:       "mount -o nodev" was useful for preventing escape from chroot/jail etc.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 21 05:10:20 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jukka A. Ukkonen
>Release:        6.2-PRERELEASE
>Organization:
private person
>Environment:
FreeBSD mjolnir 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #2: Wed Sep 20 08:33:47 EEST 2006     root at mjolnir:/usr/obj/usr/src/sys/Mjolnir  i386

>Description:
It seems the mount option nodev no longer exists.
It had its merits in making it harder to escape from chroot/jail.
One known method for such escapes has been making a new device entry
matching the major and minor device numbers of the actual /, mounting
it inside the confinded file system, and chroot()ing to it.

Now that devfs is the only place where device entries should live
having nodev around would make all the more sense.
All the other mount points could be marked nodev in the fstab.

>How-To-Repeat:
An easy way to test the "nodev" option is gone is to simply try using it with
a suitable test mount point.
"mount -o nodev" and the option "nodev" in fstab no longer are shown in
the output of "mount -p".
Also <sys/mount.h> defines it as...
#define MNT_NODEV       0               /* Deprecated option */

The normal file systems still can contain device nodes as before...
mknod rootdev c 0 142
The mknod creates a copy of a geom mirror used as the actual system root
in the system this was tried on.

Though jail can confine areas better than plain chroot also the latter
one will be around for quite some time. Having "mount -o nodev" around
would be one more addition to the layered onion like security.

>Fix:
If the nodev option was not awfully hard to maintain, please, return it to
the system.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list