devfs

Albert D. Cahalan (acahalan@cs.uml.edu)
Thu, 8 Jan 1998 01:23:01 -0500 (EST)


I've seen a few "nothing is broken" posts. Things _are_ broken.
Leaving aside the issue of a bloated /dev full of junk I don't
have, there are some serious reasons for a devfs. It needs to
be a real devfs too, not some weak hack.

*** Read-only filesystems ***
The FSSTND (Linux filesystem standard document) suggests the possibility
of a read-only root filesystem. Read-only filesystems help reduce the
chance that mistakes, crashes, and crackers (evil hackers) might damage
something. The Linux root filesystem can not be read-only because the
normal /dev must be read-write to allow tty ownership changes. With the
devfs, the root filesystem can be read-only. The current /dev could be
trouble for Linux embedded in ROM.

*** NTFS ***
With a devfs, NTFS could be used as the root filesystem. The NT
filesystem supports POSIX file storage, but does not support device
files. Linux support for NTFS is in development, but NTFS will not
be useable as a root filesystem until the normal /dev can be avoided.

*** PTY security ***
When a pty is needed, root must change the owner. When that pty is
not needed anymore, root must change the owner back again. There are
problems with that method, because it means that many programs should
be setuid root. Emacs shell windows leave a security hole because the
pty owner never gets changed. Many programs can fail to change the pty
owner back.
With devfs, the kernel can chown ptys back to root when a process
does not need them anymore. The kernel might be able to let normal
users chown their own pty or it might perform the chown automatically.