]> git.baikalelectronics.ru Git - kernel.git/commit
x86/selftests/pkeys: Fork() to check for state being preserved
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 2 Jan 2019 21:56:57 +0000 (13:56 -0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 15 Jan 2019 09:33:45 +0000 (10:33 +0100)
commitaf6e545056331ed65288d153ee9b41ec73424c38
tree328183acbd91c6c49a08fc8a860d90672d304d0c
parent4757b2535ef3ef3600c69f4c87969e17bf0b1c9b
x86/selftests/pkeys: Fork() to check for state being preserved

There was a bug where the per-mm pkey state was not being preserved across
fork() in the child.  fork() is performed in the pkey selftests, but all of
the pkey activity is performed in the parent.  The child does not perform
any actions sensitive to pkey state.

To make the test more sensitive to these kinds of bugs, add a fork() where
the parent exits, and execution continues in the child.

To achieve this let the key exhaustion test not terminate at the first
allocation failure and fork after 2*NR_PKEYS loops and continue in the
child.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: peterz@infradead.org
Cc: mpe@ellerman.id.au
Cc: will.deacon@arm.com
Cc: luto@kernel.org
Cc: jroedel@suse.de
Cc: stable@vger.kernel.org
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Joerg Roedel <jroedel@suse.de>
Link: https://lkml.kernel.org/r/20190102215657.585704B7@viggo.jf.intel.com
tools/testing/selftests/x86/protection_keys.c