diff options
author | Ming Lei <ming.lei@canonical.com> | 2013-04-02 10:12:26 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-03 11:09:02 -0700 |
commit | f7db5e7660b122142410dcf36ba903c73d473250 (patch) | |
tree | 5385cf0537e4cad0a2896070c45f2b492a74f0ff /fs/devpts | |
parent | 0f8b1a0204a12441cddbbf5be31e6338e0b8da1c (diff) | |
download | linux-3.10-f7db5e7660b122142410dcf36ba903c73d473250.tar.gz linux-3.10-f7db5e7660b122142410dcf36ba903c73d473250.tar.bz2 linux-3.10-f7db5e7660b122142410dcf36ba903c73d473250.zip |
sysfs: fix use after free in case of concurrent read/write and readdir
The inode->i_mutex isn't hold when updating filp->f_pos
in read()/write(), so the filp->f_pos might be read as
0 or 1 in readdir() when there is concurrent read()/write()
on this same file, then may cause use after free in readdir().
The bug can be reproduced with Li Zefan's test code on the
link:
https://patchwork.kernel.org/patch/2160771/
This patch fixes the use after free under this situation.
Cc: stable <stable@vger.kernel.org>
Reported-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/devpts')
0 files changed, 0 insertions, 0 deletions