aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-01-10 22:40:55 -0800
committerZiyan <jaraidaniel@gmail.com>2016-10-29 01:34:06 +0200
commit9d600c6bd8bf43f1bd5ab54548777e8d31af8659 (patch)
tree4abb09b9806377bd6480eb9bbc3cecf4a1dec253 /fs
parentda545e17c25249ec226102b9c2c240b4694e8e91 (diff)
downloadkernel_samsung_tuna-9d600c6bd8bf43f1bd5ab54548777e8d31af8659.zip
kernel_samsung_tuna-9d600c6bd8bf43f1bd5ab54548777e8d31af8659.tar.gz
kernel_samsung_tuna-9d600c6bd8bf43f1bd5ab54548777e8d31af8659.tar.bz2
tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
ioctl(TIOCGETD) retrieves the line discipline id directly from the ldisc because the line discipline id (c_line) in termios is untrustworthy; userspace may have set termios via ioctl(TCSETS*) without actually changing the line discipline via ioctl(TIOCSETD). However, directly accessing the current ldisc via tty->ldisc is unsafe; the ldisc ptr dereferenced may be stale if the line discipline is changing via ioctl(TIOCSETD) or hangup. Wait for the line discipline reference (just like read() or write()) to retrieve the "current" line discipline id. Change-Id: I7dae813721d4631d84a7d48b7b908e3bc40617cb Cc: <stable@vger.kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions