Skip to contentSkip to conversation

syscalls/add_key02: remove test

PATCH New Eric Biggers 1 participant 1 message Jun 5, 2017 Keys/keyrings

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 syscalls/add_key02: remove test

From: Eric Biggers <[email protected]>

add_key02 was supposed to be a "Basic test for the add_key() syscall", but it actually happened to test the obscure case of passing a NULL payload with nonzero length. This case was mishandled by the kernel, which either returned EINVAL or crashed with a NULL pointer dereference, depending on the key type. (The former applied to the test, as it used the "user" key type.) The expected behavior is that the syscall fail with EFAULT.

As this is being fixed by the kernel patch "KEYS: fix dereferencing NULL payload with nonzero length", the test needed to be updated. To avoid making it appear as a regression, just remove the test; the next patch will add a replacement test as add_key03. The new test will also be more thorough as it will test other key types besides "user", including ones that cause a NULL pointer dereference in unfixed kernels.

---
 runtest/syscalls                              |  1 -
 testcases/kernel/syscalls/.gitignore          |  1 -
 testcases/kernel/syscalls/add_key/add_key02.c | 74 ---------------------------
 3 files changed, 76 deletions(-)
 delete mode 100644 testcases/kernel/syscalls/add_key/add_key02.c
runtest/syscalls +0 -1
index fe5227290..0c3c46e57 100644
@@ -12,7 +12,6 @@ access04 access04
 acct01 acct01
 
 add_key01 add_key01
-add_key02 add_key02
 
 adjtimex01 adjtimex01
 adjtimex02 adjtimex02
testcases/kernel/syscalls/.gitignore +0 -1
index c14c4e66b..5b8df06f5 100644
@@ -7,7 +7,6 @@
 /access/access04
 /acct/acct01
 /add_key/add_key01
-/add_key/add_key02
 /adjtimex/adjtimex01
 /adjtimex/adjtimex02
 /alarm/alarm01
testcases/kernel/syscalls/add_key/add_key02.c deleted +0 -74

74 lines not on this page · raw message

Signature · 1 line
2.13.0.506.g27d5fe0cd-goog