Re: [PATCH][2.1.71] BSD revoke() syscall

Theodore Y. Ts'o (tytso@MIT.EDU)
Tue, 9 Dec 1997 13:31:27 -0500


From: alan@lxorguk.ukuu.org.uk (Alan Cox)
Date: Tue, 9 Dec 1997 09:05:44 +0000 (GMT)

Have a look how the tty layer revokes access to things. Instead of putting
another check inline with every fs syscall it changes the read/write/etc
methods for the object to point to ones that return -ENXIO. That then
requires no extra changes although it does have some implicit races - as
does yours.

.... and indeed, the tty hangup revokation could be extended to be a
general sys_revoke mechanism, although the tty code currently has a
tty-special to allow a few specific tty ioctl's even on a hung-up file
descriptor. This is to allow recovery in the case where someone clears
CLOCAL, and the carrier detect line is floating. If you don't have this
special case, it's possible that you can't recover from this case.

The flip side is that the tty hangup isn't a full revoke, and
there are some (small) security issues if you have a process hanging
around after the logout.

- Ted