linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] selftests: powerpc: Fixes and execute-disable test for pkeys
@ 2020-06-04 12:56 Sandipan Das
  2020-06-04 12:56 ` [PATCH v3 1/3] selftests: powerpc: Fix pkey access right updates Sandipan Das
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sandipan Das @ 2020-06-04 12:56 UTC (permalink / raw)
  To: mpe
  Cc: linux-kselftest, linuxppc-dev, linux-mm, linuxram, aneesh.kumar,
	bauerman, fweimer, ruscur

This fixes the way the Authority Mask Register (AMR) is updated
by the existing pkey tests and adds a new test to verify the
functionality of execute-disabled pkeys.

Previous versions can be found at:
v2: https://lore.kernel.org/linuxppc-dev/20200527030342.13712-1-sandipan@linux.ibm.com/
v1: https://lore.kernel.org/linuxppc-dev/20200508162332.65316-1-sandipan@linux.ibm.com/

Changes in v3:
- Fixed AMR writes for existing pkey tests (new patch).
- Moved Hash MMU check under utilities (new patch) and removed duplicate
  code.
- Fixed comments on why the pkey permission bits were redefined.
- Switched to existing mfspr() macro for reading AMR.
- Switched to sig_atomic_t as data type for variables updated in the
  signal handlers.
- Switched to exit()-ing if the signal handlers come across an unexpected
  condition instead of trying to reset page and pkey permissions.
- Switched to write() from printf() for printing error messages from
  the signal handlers.
- Switched to getpagesize().
- Renamed fault counter to denote remaining faults.
- Dropped unnecessary randomization for choosing an address to fault at.
- Added additional information on change in permissions due to AMR and
  IAMR bits in comments.
- Switched the first instruction word of the executable region to a trap
  to test if it is actually overwritten by a no-op later.
- Added an new test scenario where the pkey imposes no restrictions and
  an attempt is made to jump to the executable region again.

Changes in v2:
- Added .gitignore entry for test binary.
- Fixed builds for older distros where siginfo_t might not have si_pkey as
  a formal member based on discussion with Michael.

Sandipan Das (3):
  selftests: powerpc: Fix pkey access right updates
  selftests: powerpc: Move Hash MMU check to utilities
  selftests: powerpc: Add test for execute-disabled pkeys

 tools/testing/selftests/powerpc/include/reg.h |   6 +
 .../testing/selftests/powerpc/include/utils.h |   1 +
 tools/testing/selftests/powerpc/mm/.gitignore |   1 +
 tools/testing/selftests/powerpc/mm/Makefile   |   5 +-
 .../selftests/powerpc/mm/bad_accesses.c       |  28 --
 .../selftests/powerpc/mm/pkey_exec_prot.c     | 388 ++++++++++++++++++
 .../selftests/powerpc/ptrace/core-pkey.c      |   2 +-
 .../selftests/powerpc/ptrace/ptrace-pkey.c    |   2 +-
 tools/testing/selftests/powerpc/utils.c       |  28 ++
 9 files changed, 429 insertions(+), 32 deletions(-)
 create mode 100644 tools/testing/selftests/powerpc/mm/pkey_exec_prot.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-16 12:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 12:56 [PATCH v3 0/3] selftests: powerpc: Fixes and execute-disable test for pkeys Sandipan Das
2020-06-04 12:56 ` [PATCH v3 1/3] selftests: powerpc: Fix pkey access right updates Sandipan Das
2020-06-04 12:56 ` [PATCH v3 2/3] selftests: powerpc: Move Hash MMU check to utilities Sandipan Das
2020-06-04 12:56 ` [PATCH v3 3/3] selftests: powerpc: Add test for execute-disabled pkeys Sandipan Das
2020-07-16 12:56 ` [PATCH v3 0/3] selftests: powerpc: Fixes and execute-disable test for pkeys Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).