Skip to contentSkip to conversation

selftests/prctl: Test PR_SET_MM_AUXV terminator

PATCH New Sahaj Chaudhari 1 participant 1 message Oct 7 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/prctl: Test PR_SET_MM_AUXV terminator

Verify that a shortened vector supplied through PR_SET_MM_AUXV has a valid AT_NULL terminator when exposed through /proc/self/auxv. This catches stale AUXV entries left beyond the supplied vector.

---
 tools/testing/selftests/prctl/.gitignore      |  1 +
 tools/testing/selftests/prctl/Makefile        |  1 +
 .../testing/selftests/prctl/pr_set_mm_auxv.c  | 42 +++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100644 tools/testing/selftests/prctl/pr_set_mm_auxv.c
tools/testing/selftests/prctl/.gitignore +1 -0
index 05d5e31661dfd..089af0296aeca 100644
@@ -4,3 +4,4 @@ disable-tsc-on-off-stress-test
 disable-tsc-test
 set-anon-vma-name-test
 set-process-name
+pr_set_mm_auxv
tools/testing/selftests/prctl/Makefile +1 -0
index e770e86fad9ac..a21811a8f6a06 100644
@@ -6,6 +6,7 @@ override ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
 ifeq ($(ARCH),x86)
 TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \
 		disable-tsc-test set-anon-vma-name-test set-process-name
+TEST_GEN_PROGS := pr_set_mm_auxv
 all: $(TEST_PROGS)
 
 include ../lib.mk
tools/testing/selftests/prctl/pr_set_mm_auxv.c new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
2.43.0