All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] selftests-mm-fix-ptrace-peekdata-check-in-memfd_secret-test.patch removed from -mm tree
@ 2026-10-09  5:58 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-09  5:58 UTC (permalink / raw)
  To: mm-commits, vbabka, surenb, shuah, rppt, mhocko, ljs, liam,
	james.bottomley, david, lihongfu, akpm


The quilt patch titled
     Subject: selftests/mm: fix ptrace PEEKDATA check in memfd_secret test
has been removed from the -mm tree.  Its filename was
     selftests-mm-fix-ptrace-peekdata-check-in-memfd_secret-test.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Hongfu Li <lihongfu@kylinos.cn>
Subject: selftests/mm: fix ptrace PEEKDATA check in memfd_secret test
Date: Thu, 10 Sep 2026 14:44:15 +0800

try_ptrace() treats PTRACE_PEEKDATA return value as a boolean check.  A
successful read returns non-zero data (memory filled with 0x55), causing
the test to incorrectly report PASS when secret memory protection is
broken.

Check the return value against -1 instead.  The test should only pass when
PTRACE_PEEKDATA fails, which means secret memory protection works.

Link: https://lore.kernel.org/20260910064415.71623-1-hongfu.li@linux.dev
Fixes: 76fe17ef588a ("secretmem: test: add basic selftest for memfd_secret(2)")
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: James Bottomley <james.bottomley@HansenPartnership.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
---

 tools/testing/selftests/mm/memfd_secret.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/tools/testing/selftests/mm/memfd_secret.c~selftests-mm-fix-ptrace-peekdata-check-in-memfd_secret-test
+++ a/tools/testing/selftests/mm/memfd_secret.c
@@ -145,7 +145,8 @@ static void try_ptrace(int fd, int pipef
 		exit(KSFT_FAIL);
 	}
 
-	if (ptrace(PTRACE_PEEKDATA, ppid, mem, 0))
+	/* PEEKDATA on secret memory must fail, else protection is broken. */
+	if (ptrace(PTRACE_PEEKDATA, ppid, mem, 0) == -1)
 		exit(KSFT_PASS);
 
 	exit(KSFT_FAIL);
_

Patches currently in -mm which might be from lihongfu@kylinos.cn are

mm-hugetlb_cgroup-move-per-node-usage-on-cross-node-migration.patch
mm-hugetlb_cgroup-move-per-node-usage-on-cgroup-reparenting.patch
mm-hugetlb-account-migration-target-folio-in-per-node-nr_hugetlb-vmstat.patch
mm-memcg-migrate-per-node-hugetlb-lruvec-stat-together-with-hugetlb-folio.patch
mm-memfd-fix-hugetlb-reservation-accounting-in-error-paths.patch


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

only message in thread, other threads:[~2026-10-09  5:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09  5:58 [merged mm-stable] selftests-mm-fix-ptrace-peekdata-check-in-memfd_secret-test.patch removed from -mm tree 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.