]> git.baikalelectronics.ru Git - kernel.git/commit
tty: Reset hupped state on open
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 19 Nov 2013 13:46:27 +0000 (08:46 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2013 16:56:49 +0000 (08:56 -0800)
commit7ffb2a72f6ca676271e67d988de14fc484e1e542
treed518a39edafd6f58befb8d9f048ae8294b97b0b0
parent07b4364d9d1334295ce9fb19444e895bc7af314e
tty: Reset hupped state on open

A common security idiom is to hangup the current tty (via vhangup())
after forking but before execing a root shell. This hangs up any
existing opens which other processes may have and ensures subsequent
opens have the necessary permissions to open the root shell tty/pty.

Reset the TTY_HUPPED state after the driver has successfully
returned the opened tty (perform the reset while the tty is locked
to avoid racing with concurrent hangups).

Reported-by: Heorhi Valakhanovich <valahanovich@tut.by>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Cc: stable <stable@vger.kernel.org> # 3.12
Tested-by: Heorhi Valakhanovich <valahanovich@tut.by>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c