selftests/powerpc: Add test for pkey siginfo verification
authorSandipan Das <sandipan@linux.ibm.com>
Mon, 27 Jul 2020 04:00:40 +0000 (09:30 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jul 2020 11:02:10 +0000 (21:02 +1000)
commitc27f2fd1705a7e19ef2dc2b986c0d1cde3c3dbe7
tree3d0708f0f3338768d87fff8b085e088b5b3e47a0
parent743f3544fffb9662aaf550c8358a8c1b6fcae707
selftests/powerpc: Add test for pkey siginfo verification

Commit c46241a370a61 ("powerpc/pkeys: Check vma before
returning key fault error to the user") fixes a bug which
causes the kernel to set the wrong pkey in siginfo when a
pkey fault occurs after two competing threads that have
allocated different pkeys, one fully permissive and the
other restrictive, attempt to protect a common page at the
same time. This adds a test to detect the bug.

Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ce40b6ee270bda52e8f4088578ed2faf7d1d509a.1595821792.git.sandipan@linux.ibm.com
tools/testing/selftests/powerpc/mm/.gitignore
tools/testing/selftests/powerpc/mm/Makefile
tools/testing/selftests/powerpc/mm/pkey_siginfo.c [new file with mode: 0644]