summaryrefslogtreecommitdiffstats
path: root/include/linux/devpts_fs.h
diff options
context:
space:
mode:
authorHerton R. Krzesinski2016-01-11 15:07:43 +0100
committerGreg Kroah-Hartman2016-02-07 08:45:46 +0100
commit2831c89f42dcde440cfdccb9fee9f42d54bbc1ef (patch)
treecf69785b4edd19e4a59549de860b0d00f920df1a /include/linux/devpts_fs.h
parenttty: Add support for PCIe WCH382 2S multi-IO card (diff)
downloadkernel-qcow2-linux-2831c89f42dcde440cfdccb9fee9f42d54bbc1ef.tar.gz
kernel-qcow2-linux-2831c89f42dcde440cfdccb9fee9f42d54bbc1ef.tar.xz
kernel-qcow2-linux-2831c89f42dcde440cfdccb9fee9f42d54bbc1ef.zip
pty: fix possible use after free of tty->driver_data
This change fixes a bug for a corner case where we have the the last release from a pty master/slave coming from a previously opened /dev/tty file. When this happens, the tty->driver_data can be stale, due to all ptmx or pts/N files having already been closed before (and thus the inode related to these files, which tty->driver_data points to, being already freed/destroyed). The fix here is to keep a reference on the opened master ptmx inode. We maintain the inode referenced until the final pty_unix98_shutdown, and only pass this inode to devpts_kill_index. Signed-off-by: Herton R. Krzesinski <herton@redhat.com> Cc: <stable@vger.kernel.org> # 2.6.29+ Reviewed-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/devpts_fs.h')
0 files changed, 0 insertions, 0 deletions