syscalls/add_key02: update to test fix for nonempty NULL payload

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 in this case is that the
syscall fail with EFAULT.

Update the test to expect the fixed behavior from v4.12-rc5, and make
the test more thorough by testing additional key types, including ones
that caused a NULL pointer dereference in unfixed kernels.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Bug: 63693949
Test: vts-tradefed run commandAndExit vts-kernel -m VtsKernelLtp \
      -t syscalls.add_key02_{32,64}bit
Signed-off-by: Steve Muckle <smuckle@google.com>
Merged-In: I09b09fbae97c458d130573bd42ae883473c9ea5f
Change-Id: I09b09fbae97c458d130573bd42ae883473c9ea5f
1 file changed