Add a regression test for CVE-2017-1000380
PATCH v3 1/1 Add a regression test for CVE-2017-1000380
A race condition was present in the linux kernel, which could lead to a leak of arbitrary kernel memory to userspace applications.
The issue was fixed in those kernel commits:
http://git.kernel.org/linus/d11662f4f798b50d8c8743f433842c3e40fe3378
http://git.kernel.org/linus/ba3021b2c79b2fa9114f92790a99deb27a65b728
This patch adds a regression test triggering this race condition.
Signed-off-by Michael Moese <[email protected]>
---
Changes to v1:
- Initialize buffers in ioctl_thread() outside of the loop
- use return unused() instead of a void* cast of NULL in ioctl_thread()
- reset non-zero flag in run() for every iteration of the main loop
--- runtest/cve | 1 + testcases/kernel/Makefile | 1 + testcases/kernel/sound/.gitignore | 1 + testcases/kernel/sound/Makefile | 12 +++ testcases/kernel/sound/snd_timer01.c | 140 +++++++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100644 testcases/kernel/sound/.gitignore create mode 100644 testcases/kernel/sound/Makefile create mode 100644 testcases/kernel/sound/snd_timer01.c
runtest/cve +1 -0
@@ -36,6 +36,7 @@ cve-2017-17052 cve-2017-17052 cve-2017-16939 cve-2017-16939 cve-2017-17053 cve-2017-17053 cve-2017-18075 pcrypt_aead01 +cve-2017-1000380 snd_timer01 cve-2018-5803 sctp_big_chunk cve-2018-1000001 realpath01 cve-2018-19854 crypto_user01
testcases/kernel/Makefile +1 -0
@@ -52,6 +52,7 @@ SUBDIRS += connectors \ pty \ sched \ security \ + sound \ timers \ tracing \
testcases/kernel/sound/.gitignore new file +1 -0
@@ -0,0 +1 @@ +snd_timer
testcases/kernel/sound/Makefile new file +12 -0
@@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +top_srcdir := ../../.. + +include $(top_srcdir)/include/mk/testcases.mk + +CPPFLAGS += -D_GNU_SOURCE + +LDLIBS += -pthread + + +include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/sound/snd_timer01.c new file +140 -0
140 lines not on this page · raw message
Signature · 1 line
2.22.0