1
0
Fork 0
alistair23-linux/samples
Sargun Dhillon de7cd9dfc5 samples/seccomp: Zero out members based on seccomp_notif_sizes
commit 771b894f2f upstream.

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: Sargun Dhillon <sargun@sargun.me>
Suggested-by: Tycho Andersen <tycho@tycho.ws>
Link: https://lore.kernel.org/r/20191230203503.4925-1-sargun@sargun.me
Fixes: fec7b66905 ("samples: add an example of seccomp user trap")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-09 10:19:57 +01:00
..
auxdisplay auxdisplay: Fix a typo in cfag12864b-example.c 2019-08-08 20:00:18 +02:00
binderfs treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
bpf samples/bpf: fix build by setting HAVE_ATTR_TEST to zero 2019-10-31 21:39:15 +01:00
configfs treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 145 2019-05-30 11:25:18 -07:00
connector treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
hidraw HID: samples/hidraw: fix typo in printed message 2018-11-21 00:31:58 +01:00
hw_breakpoint treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
kdb treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kfifo treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 465 2019-06-19 17:09:10 +02:00
kobject treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kprobes treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
livepatch treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
mei samples: mei: use /dev/mei0 instead of /dev/mei 2019-01-30 15:24:45 +01:00
mic/mpssd treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 290 2019-06-05 17:36:38 +02:00
pidfd samples: make pidfd-metadata fail gracefully on older kernels 2019-06-24 15:55:50 +02:00
pktgen samples: pktgen: fix proc_cmd command result check logic 2019-12-31 16:43:45 +01:00
qmi treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rpmsg samples/rpmsg: Introduce a module parameter for message count 2019-08-26 22:10:39 -07:00
seccomp samples/seccomp: Zero out members based on seccomp_notif_sizes 2020-01-09 10:19:57 +01:00
timers License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace_events sched/core: Provide a pointer to the valid CPU mask 2019-06-03 11:49:37 +02:00
trace_printk treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
uhid treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
v4l media: v4l2-pci-skeleton.c: fix doc warning 2019-05-28 13:14:28 -04:00
vfio-mdev vfio-mdev/mtty: Simplify interrupt generation 2019-08-19 13:28:57 -06:00
vfs treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
watchdog License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
Makefile kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples 2019-06-15 19:57:01 +09:00