Skip to content
Commit 771b894f authored by Sargun Dhillon's avatar Sargun Dhillon Committed by Kees Cook
Browse files

samples/seccomp: Zero out members based on seccomp_notif_sizes



The sizes by which seccomp_notif and seccomp_notif_resp are allocated are
based on the SECCOMP_GET_NOTIF_SIZES ioctl. This allows for graceful
extension of these datastructures. If userspace zeroes out the
datastructure based on its version, and it is lagging behind the kernel's
version, it will end up sending trailing garbage. On the other hand,
if it is ahead of the kernel version, it will write extra zero space,
and potentially cause corruption.

Signed-off-by: default avatarSargun Dhillon <sargun@sargun.me>
Suggested-by: default avatarTycho Andersen <tycho@tycho.ws>
Link: https://lore.kernel.org/r/20191230203503.4925-1-sargun@sargun.me


Fixes: fec7b669 ("samples: add an example of seccomp user trap")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent fd698849
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