diff options
author | Herton R. Krzesinski <herton@redhat.com> | 2016-01-11 17:07:43 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-03-02 23:19:15 +0300 |
commit | f8b4df5f7d7af74cf5270fbce89a089ecfe73604 (patch) | |
tree | db6b51daf87b37e0ef2d3436bcce3693eb50eb45 /fs/devpts | |
parent | f46aa4a4ac73e4d0dcc90f757879477053774df2 (diff) | |
download | linux-f8b4df5f7d7af74cf5270fbce89a089ecfe73604.tar.xz |
pty: fix possible use after free of tty->driver_data
[ Upstream commit 2831c89f42dcde440cfdccb9fee9f42d54bbc1ef ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'fs/devpts')
0 files changed, 0 insertions, 0 deletions