Skip to content
Commit a811dc61 authored by Tycho Andersen's avatar Tycho Andersen Committed by James Morris
Browse files

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: default avatar <syzbot+981c26489b2d1c6316ba@syzkaller.appspotmail.com>
Fixes: 6a21cc50 ("seccomp: add a return code to trap to userspace")
Signed-off-by: default avatarTycho Andersen <tycho@tycho.ws>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent 7939f8be
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment