]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Improve nested jail awareness of devfs by handling credentials.
authorEd Schouten <ed@FreeBSD.org>
Sat, 20 Jun 2009 14:50:32 +0000 (14:50 +0000)
committerEd Schouten <ed@FreeBSD.org>
Sat, 20 Jun 2009 14:50:32 +0000 (14:50 +0000)
commitf8f6146082e8bb49d8337f450b1f60402ef5c4e2
treef0fd4ecb52c9718823a0b05d1efd9e87c9c6be2c
parent6c3154f6a1243d7ab8832c46dd6853aba514739a
Improve nested jail awareness of devfs by handling credentials.

Now that we start to use credentials on character devices more often
(because of MPSAFE TTY), move the prison-checks that are in place in the
TTY code into devfs.

Instead of strictly comparing the prisons, use the more common
prison_check() function to compare credentials. This means that
pseudo-terminals are only visible in devfs by processes within the same
jail and parent jails.

Even though regular users in parent jails can now interact with
pseudo-terminals from child jails, this seems to be the right approach.
These processes are also capable of interacting with the jailed
processes anyway, through signals for example.

Reviewed by: kib, rwatson (older version)
sys/fs/devfs/devfs_vnops.c
sys/kern/tty.c
sys/sys/priv.h