Skip to contentSkip to conversation

Add test keyctl08 for cve-2016-9604 on keyctl_join_session_keyring

PATCH New Richard Palethorpe 2 participants 2 messages Nov 1, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add test keyctl08 for cve-2016-9604 on keyctl_join_session_keyring

Check key names starting with "." are disallowed.

---
 include/lapi/keyctl.h                       |  5 ++++
 runtest/cve                                 |  1 +
 runtest/syscalls                            |  1 +
 testcases/kernel/syscalls/.gitignore        |  1 +
 testcases/kernel/syscalls/keyctl/keyctl08.c | 44 +++++++++++++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 testcases/kernel/syscalls/keyctl/keyctl08.c
include/lapi/keyctl.h +5 -0
index 8e6beac0e..328e55763 100644
@@ -65,6 +65,11 @@ static inline long keyctl(int cmd, ...)
 
 	return tst_syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5);
 }
+
+static inline key_serial_t keyctl_join_session_keyring(const char *name) {
+	return keyctl(KEYCTL_JOIN_SESSION_KEYRING, name);
+}
+
 #endif /* defined(HAVE_KEYUTILS_H) && defined(HAVE_LIBKEYUTILS) */
 
 /* special process keyring shortcut IDs */
runtest/cve +1 -0
index 1719997cc..bea7b3b5b 100644
@@ -11,6 +11,7 @@ cve-2016-4997 cve-2016-4997
 cve-2016-5195 dirtyc0w
 cve-2016-7042 cve-2016-7042
 cve-2016-7117 cve-2016-7117
+cve-2016-9604 keyctl08
 cve-2016-10044 cve-2016-10044
 cve-2017-2618 cve-2017-2618
 cve-2017-2671 cve-2017-2671
runtest/syscalls +1 -0
index 323947556..67c1ba7f0 100644
@@ -505,6 +505,7 @@ keyctl04 keyctl04
 keyctl05 keyctl05
 keyctl06 keyctl06
 keyctl07 keyctl07
+keyctl08 keyctl08
 
 kcmp01 kcmp01
 kcmp02 kcmp02
testcases/kernel/syscalls/.gitignore +1 -0
index a988e6b6e..805fe119e 100644
@@ -466,6 +466,7 @@
 /keyctl/keyctl05
 /keyctl/keyctl06
 /keyctl/keyctl07
+/keyctl/keyctl08
 /kcmp/kcmp01
 /kcmp/kcmp02
 /kcmp/kcmp03
testcases/kernel/syscalls/keyctl/keyctl08.c new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.14.3
#1 lore raw

PATCH v2 1/1 Add test keyctl08 for cve-2016-9604 on keyctl_join_session_keyring

Hi!
Pushed, thanks.

Signature · 2 lines
Cyril Hrubis
[email protected]