linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Lower the ptrace permissions so that the memfd_secrect test program runs without an issue.
@ 2023-10-30  8:54 Itaru Kitayama
  0 siblings, 0 replies; only message in thread
From: Itaru Kitayama @ 2023-10-30  8:54 UTC (permalink / raw)
  To: Andrew Morton, Shuah Khan
  Cc: linux-mm, linux-kselftest, linux-kernel, Itaru Kitayama



---
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. 

Signed-off-by: Itaru Kitayama <itaru.kitayama@linux.dev>
---
 tools/testing/selftests/mm/run_vmtests.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/mm/run_vmtests.sh b/tools/testing/selftests/mm/run_vmtests.sh
index 3e2bc818d566..7d31718ce834 100755
--- a/tools/testing/selftests/mm/run_vmtests.sh
+++ b/tools/testing/selftests/mm/run_vmtests.sh
@@ -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

---
base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa
change-id: 20231030-selftest-c75b1b460817

Best regards,
-- 
Itaru Kitayama <itaru.kitayama@linux.dev>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-30  8:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30  8:54 [PATCH] Lower the ptrace permissions so that the memfd_secrect test program runs without an issue Itaru Kitayama

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).