]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tools/testing/selftests/mm/run_vmtests.sh: lower the ptrace permissions
authorItaru Kitayama <itaru.kitayama@linux.dev>
Mon, 30 Oct 2023 08:54:45 +0000 (17:54 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 1 Nov 2023 19:46:59 +0000 (12:46 -0700)
On Ubuntu and probably other distros, ptrace permissions are tightend a
bit by default; i.e., /proc/sys/kernel/yama/ptrace_score is set to 1.
This cases memfd_secret's ptrace attach test fails with a permission
error.  Set it to 0 piror to running the program.

Link: https://lkml.kernel.org/r/20231030-selftest-v1-1-743df68bb996@linux.dev
Signed-off-by: Itaru Kitayama <itaru.kitayama@linux.dev>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/run_vmtests.sh

index 3e2bc818d566f6dfe3cba5eb84c55537611d6413..7d31718ce8343db04ad51351cc862020b7698d28 100755 (executable)
@@ -303,6 +303,7 @@ CATEGORY="hmm" run_test bash ./test_hmm.sh smoke
 # MADV_POPULATE_READ and MADV_POPULATE_WRITE tests
 CATEGORY="madv_populate" run_test ./madv_populate
 
+echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
 CATEGORY="memfd_secret" run_test ./memfd_secret
 
 # KSM KSM_MERGE_TIME_HUGE_PAGES test with size of 100