diff options
author | Tycho Andersen <tycho@tycho.ws> | 2019-01-12 19:24:20 +0100 |
---|---|---|
committer | James Morris <james.morris@microsoft.com> | 2019-01-15 18:43:12 +0100 |
commit | a811dc61559e0c8003f1086c2a4dc8e4d5ae4cb8 (patch) | |
tree | 56144b909f723d0bf4365c2ccbd8ec2e24d9907d /mm/balloon_compaction.c | |
parent | Merge tag 'trace-v5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/r... (diff) | |
download | linux-a811dc61559e0c8003f1086c2a4dc8e4d5ae4cb8.tar.xz linux-a811dc61559e0c8003f1086c2a4dc8e4d5ae4cb8.zip |
seccomp: fix UAF in user-trap code
On the failure path, we do an fput() of the listener fd if the filter fails
to install (e.g. because of a TSYNC race that's lost, or if the thread is
killed, etc.). fput() doesn't actually release the fd, it just ads it to a
work queue. Then the thread proceeds to free the filter, even though the
listener struct file has a reference to it.
To fix this, on the failure path let's set the private data to null, so we
know in ->release() to ignore the filter.
Reported-by: syzbot+981c26489b2d1c6316ba@syzkaller.appspotmail.com
Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace")
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: James Morris <james.morris@microsoft.com>
Diffstat (limited to 'mm/balloon_compaction.c')
0 files changed, 0 insertions, 0 deletions