Skip to content

Commit

Permalink
selftests/powerpc: Add test for execute-disabled pkeys
Browse files Browse the repository at this point in the history
Apart from read and write access, memory protection keys can
also be used for restricting execute permission of pages on
powerpc. This adds a test to verify if the feature works as
expected.

Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200604125610.649668-4-sandipan@linux.ibm.com
  • Loading branch information
Sandipan Das authored and Michael Ellerman committed Jun 30, 2020
1 parent c405b73 commit 1addb64
Show file tree
Hide file tree
Showing 3 changed files with 391 additions and 1 deletion.
1 change: 1 addition & 0 deletions tools/testing/selftests/powerpc/mm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ wild_bctr
large_vm_fork_separation
bad_accesses
tlbie_test
pkey_exec_prot
3 changes: 2 additions & 1 deletion tools/testing/selftests/powerpc/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ noarg:
$(MAKE) -C ../

TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao segv_errors wild_bctr \
large_vm_fork_separation bad_accesses
large_vm_fork_separation bad_accesses pkey_exec_prot
TEST_GEN_PROGS_EXTENDED := tlbie_test
TEST_GEN_FILES := tempfile

Expand All @@ -17,6 +17,7 @@ $(OUTPUT)/prot_sao: ../utils.c
$(OUTPUT)/wild_bctr: CFLAGS += -m64
$(OUTPUT)/large_vm_fork_separation: CFLAGS += -m64
$(OUTPUT)/bad_accesses: CFLAGS += -m64
$(OUTPUT)/pkey_exec_prot: CFLAGS += -m64

$(OUTPUT)/tempfile:
dd if=/dev/zero of=$@ bs=64k count=1
Expand Down
Loading

0 comments on commit 1addb64

Please sign in to comment.