// SPDX-License-Identifier: GPL-2.0
/*
* Tests Memory Protection Keys (see Documentation/core-api/protection-keys.rst)
*
* There are examples in here of:
* * how to set protection keys on memory
* * how to set/clear bits in pkey registers (the rights register)
* * how to handle SEGV_PKUERR signals and extract pkey-relevant
* information from the siginfo
*
* Things to add:
* make sure KSM and KSM COW breaking works
* prefault pages in at malloc, or not
* protect MPX bounds tables with protection keys?
* make sure VMA splitting/merging is working correctly
* OOMs can destroy mm->mmap (see exit_mmap()), so make sure it is immune to pkeys
* look for pkey "leaks" where it is still set on a VMA but "freed" back to