]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/seccomp: Catch garbage on SECCOMP_IOCTL_NOTIF_RECV
authorSargun Dhillon <sargun@sargun.me>
Mon, 30 Dec 2019 20:38:11 +0000 (12:38 -0800)
committerKees Cook <keescook@chromium.org>
Thu, 2 Jan 2020 21:15:45 +0000 (13:15 -0800)
commitc3cb286ddfaeeec16e56cd461db34892ea67da0d
tree5ceffa20d8e817119506f5feddc9d28da802f5f8
parent047b68af0295f02f9dbe46c300f181b9a0bad777
selftests/seccomp: Catch garbage on SECCOMP_IOCTL_NOTIF_RECV

This adds logic to the user_notification_basic test to set a member
of struct seccomp_notif to an invalid value to ensure that the kernel
returns EINVAL if any of the struct seccomp_notif members are set to
invalid values.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Suggested-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20191230203811.4996-1-sargun@sargun.me
Fixes: 388c4c8f99d2 ("seccomp: add a return code to trap to userspace")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
tools/testing/selftests/seccomp/seccomp_bpf.c