freebsd-dev/sys/fs
Ed Schouten 8dc9b4cf04 Let access overriding to TTYs depend on the cdev_priv, not the vnode.
Basically this commit changes two things, which improves access to TTYs
in exceptional conditions. Basically the problem was that when you ran
jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the
node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if
you want to attach to screens quickly, use ssh(1), etc.

The fixes:

- Cache the cdev_priv of the controlling TTY in struct session. Change
  devfs_access() to compare against the cdev_priv instead of the vnode.
  This allows you to bypass UNIX permissions, even across different
  mounts of devfs.

- Extend devfs_prison_check() to unconditionally expose the device node
  of the controlling TTY, even if normal prison nesting rules normally
  don't allow this. This actually allows you to interact with this
  device node.

To be honest, I'm not really happy with this solution. We now have to
store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp).
In an ideal world, we should just get rid of the latter two and only use
s_ttyp, but this makes certian pieces of code very impractical (e.g.
devfs, kern_exit.c).

Reported by:	Many people
2009-12-19 18:42:12 +00:00
..
cd9660 In vn_vget_ino() and their inline equivalents, mnt_ref() the mount point 2009-07-02 18:02:55 +00:00
coda Change the type of uio_resid member of struct uio from int to ssize_t. 2009-06-25 18:46:30 +00:00
deadfs Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF. 2008-12-12 00:59:36 +00:00
devfs Let access overriding to TTYs depend on the cdev_priv, not the vnode. 2009-12-19 18:42:12 +00:00
fdescfs Report all fdescfs vnodes as VCHR for stat(2). Fake the unique 2009-05-12 09:28:45 +00:00
fifofs - Improve comments about locking of the "struct fifoinfo" which is a bit 2009-11-06 22:29:46 +00:00
hpfs Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
msdosfs Revert previous commit and add myself to the list of people who should 2009-09-08 13:19:05 +00:00
nfs Remove unneeded ifdefs. 2009-12-03 18:03:42 +00:00
nfsclient Remove unneeded ifdefs. 2009-12-03 18:03:42 +00:00
nfsserver Allow using IPv6 in nfsrvd_sentcache() callback. 2009-12-08 23:43:50 +00:00
ntfs Fix ntfs such that it understand media with a non-512-bytes sector size: 2009-12-07 15:15:08 +00:00
nullfs Add explicit struct ucred * argument for VOP_VPTOCNP, to be used by 2009-06-21 19:21:01 +00:00
nwfs Eliminate the unnecessary clearing of a page's dirty bits from 2009-05-23 18:25:11 +00:00
portalfs Don't use ap->a_td->td_ucred when we were passed ap->a_cred. 2009-12-02 18:09:22 +00:00
procfs Add per-process osrel node to the procfs, to allow read and set p_osrel 2009-09-23 12:08:08 +00:00
pseudofs If a race is detected, pfs_vncache_alloc() may reclaim a vnode that had 2009-09-07 12:10:41 +00:00
smbfs Spell DIAGNOSTIC correctly. 2009-10-24 18:49:17 +00:00
tmpfs There is no need to "busy" a page when the object is locked for the duration 2009-10-26 18:02:05 +00:00
udf Use #ifdef APPLE_MAC instead of #ifdef MAC to conditionalize Apple-specific 2009-06-06 07:13:57 +00:00
unionfs Fix some LORs between vnode locks and filedescriptor table locks. 2009-07-31 13:40:06 +00:00