* + selftests-mm-protection_keys-use-_exit-in-aarch64-ptrace-tracee.patch added to mm-new branch
@ 2026-11-17 5:48 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-17 5:48 UTC (permalink / raw)
To: mm-commits, vbabka, surenb, shuah, rppt, mhocko, ljs, liam, david,
lihongfu, akpm
The patch titled
Subject: selftests/mm: protection_keys: use _exit() in aarch64 ptrace tracee
has been added to the -mm mm-new branch. Its filename is
selftests-mm-protection_keys-use-_exit-in-aarch64-ptrace-tracee.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-protection_keys-use-_exit-in-aarch64-ptrace-tracee.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
The mm-new branch of mm.git is not included in linux-next
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is included in linux-next
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Hongfu Li <lihongfu@kylinos.cn>
Subject: selftests/mm: protection_keys: use _exit() in aarch64 ptrace tracee
Date: Mon, 16 Nov 2026 16:56:11 +0800
Commit 25356081894d ("selftests/mm: protection_keys: use library code
for HugeTLB setup") replaced the exit() calls in the x86 version of
test_ptrace_modifies_pkru() with _exit(), but missed the aarch64
version, which still calls exit() from the tracee.
When the test runs as root, hugepage_save_settings() registers
hugepage_restore_settings_atexit() with atexit(). The tracee inherits
the atexit list across fork(), so its exit() runs
hugepage_restore_settings_atexit() in the child. That handler calls
hugetlb_restore_settings(), which writes nr_hugepages back to the saved
original value while the test is still running. If the saved original
value is 0 (or otherwise leaves fewer than the two free huge pages
needed by the next allocation), subsequent iterations fail in
malloc_pkey_hugetlb() when mmap(MAP_HUGETLB) returns MAP_FAILED.
Use _exit() in the aarch64 tracee as well, matching x86.
This was found by code inspection with AI assistance. No POE-capable
arm64 hardware was available, so test_ptrace_modifies_pkru() was not
runtime-tested; the change has only been compile-tested with an arm64
cross-compiler.
Link: https://lore.kernel.org/20261116-for-pkey-exit-v1-1-ca4c76b32ff7@kylinos.cn
Fixes: 25356081894d ("selftests/mm: protection_keys: use library code for HugeTLB setup")
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
tools/testing/selftests/mm/protection_keys.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/tools/testing/selftests/mm/protection_keys.c~selftests-mm-protection_keys-use-_exit-in-aarch64-ptrace-tracee
+++ a/tools/testing/selftests/mm/protection_keys.c
@@ -1530,11 +1530,11 @@ static void test_ptrace_modifies_pkru(in
* checking
*/
if (__read_pkey_reg() != new_pkey)
- exit(1);
+ _exit(1);
raise(SIGSTOP);
- exit(0);
+ _exit(0);
}
pkey_assert(child == waitpid(child, &status, 0));
_
Patches currently in -mm which might be from lihongfu@kylinos.cn are
mm-hugetlb-charge-hugetlb-cgroup-and-memcg-in-alloc_hugetlb_folio_reserve.patch
selftests-mm-mlock2-tests-fix-fclosenull-in-is_vmflag_set.patch
selftests-mm-protection_keys-use-_exit-in-aarch64-ptrace-tracee.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-17 5:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 5:48 + selftests-mm-protection_keys-use-_exit-in-aarch64-ptrace-tracee.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.