tty: the vhangup syscall is racy

We now have the infrastructure to sort this out but rather than teaching
the syscall tty lock rules we move the hard work into a tty helper

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alan Cox
2008-10-13 10:40:30 +01:00
committed by Linus Torvalds
parent 216ba023a9
commit 2cb5998b5f
3 changed files with 21 additions and 2 deletions

View File

@ -1141,8 +1141,7 @@ EXPORT_SYMBOL(sys_close);
asmlinkage long sys_vhangup(void)
{
if (capable(CAP_SYS_TTY_CONFIG)) {
/* XXX: this needs locking */
tty_vhangup(current->signal->tty);
tty_vhangup_self();
return 0;
}
return -EPERM;