Skip to contentSkip to conversation

Add a regression test for CVE-2017-1000380

PATCH Superseded Michael Moese 1 participant 1 message Jul 11, 2019

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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.

---

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
index 031bcdc2a..33c9196e0 100644
@@ -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
index 39d79c7d8..eff5b3e7d 100644
@@ -52,6 +52,7 @@ SUBDIRS			+= connectors \
 			   pty \
 			   sched \
 			   security \
+			   sound \
 			   timers \
 			   tracing \
 
testcases/kernel/sound/.gitignore new file +1 -0
new file mode 100644
index 000000000..57eae0593
@@ -0,0 +1 @@
+snd_timer
testcases/kernel/sound/Makefile new file +12 -0
new file mode 100644
index 000000000..5fdc7dd42
@@ -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