]> git.baikalelectronics.ru Git - kernel.git/commit
seccomp: Check that seccomp_notif is zeroed out by the user
authorSargun Dhillon <sargun@sargun.me>
Sun, 29 Dec 2019 06:24:50 +0000 (22:24 -0800)
committerKees Cook <keescook@chromium.org>
Thu, 2 Jan 2020 21:03:45 +0000 (13:03 -0800)
commit2b9d031235835317e41a3d6b5259f6e80390e34a
tree28a5e06d8dac7c2df05519ddd05c91a601767a5e
parent4a658378d7966a14236ab6b429f594d4dcad32da
seccomp: Check that seccomp_notif is zeroed out by the user

This patch is a small change in enforcement of the uapi for
SECCOMP_IOCTL_NOTIF_RECV ioctl. Specifically, the datastructure which
is passed (seccomp_notif) must be zeroed out. Previously any of its
members could be set to nonsense values, and we would ignore it.

This ensures all fields are set to their zero value.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Aleksa Sarai <cyphar@cyphar.com>
Acked-by: Tycho Andersen <tycho@tycho.ws>
Link: https://lore.kernel.org/r/20191229062451.9467-2-sargun@sargun.me
Fixes: 6a02b13b4538 ("seccomp: add a return code to trap to userspace")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
kernel/seccomp.c