All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] fs-proc-task_mmu-fix-lost-maps-entries-above-263.patch removed from -mm tree
@ 2026-10-13 22:03 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-13 22:03 UTC (permalink / raw)
  To: mm-commits, vbabka, surenb, stable, pfalcato, ljs, liam, jannh,
	andreas, stian, akpm


The quilt patch titled
     Subject: fs/proc/task_mmu: fix lost maps entries above 2^63
has been removed from the -mm tree.  Its filename was
     fs-proc-task_mmu-fix-lost-maps-entries-above-263.patch

This patch was dropped because an updated version will be issued

------------------------------------------------------
From: Stian Halseth <stian@itx.no>
Subject: fs/proc/task_mmu: fix lost maps entries above 2^63
Date: Sun, 11 Oct 2026 18:20:19 +0200

When a read of /proc/pid/{maps,smaps,numa_maps} resumes, m_start() rewinds
*ppos to priv->last_pos so that the vma which did not fit into the
previous buffer is shown again.  It only does so for last_addr > 0,
meaning to exclude the start of the file and SENTINEL_VMA_GATE, but
last_addr is a signed loff_t holding a vm_end.  sparc64 maps shared
libraries, anonymous memory and the stack above 0x8000000000000000, so the
rewind does not happen there and one entry is lost at every read()
boundary.

Reading the maps file of a process with read sizes from 64 to 8192 bytes
in steps of 64 loses lines at 126 of the 128 sizes, smaps at 123 and
numa_maps at 97, and the proc-maps-race selftest fails 4 of its 6 tests. 
Python's sys.remote_exec() reads maps with fgets() and fails
intermittently when it misses the libpython data mapping.

Test for the two values that are not a vma end instead.

Link: https://lore.kernel.org/20261011162019.922436-1-stian@itx.no
Fixes: 5631da56c9a8 ("fs/proc/task_mmu: read proc/pid/maps under per-vma lock")
Signed-off-by: Stian Halseth <stian@itx.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Closes: https://github.com/sparclinux/issues/issues/111
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: <stable@vger.kernel.org>
---

 fs/proc/task_mmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/task_mmu.c~fs-proc-task_mmu-fix-lost-maps-entries-above-263
+++ a/fs/proc/task_mmu.c
@@ -263,7 +263,7 @@ static void *m_start(struct seq_file *m,
 	 * Reset current position if last_addr was set before
 	 * and it's not a sentinel.
 	 */
-	if (last_addr > 0)
+	if (last_addr && last_addr != SENTINEL_VMA_GATE)
 		*ppos = last_addr = priv->last_pos;
 	vma_iter_init(&priv->iter, mm, (unsigned long)last_addr);
 	hold_task_mempolicy(priv);
_

Patches currently in -mm which might be from stian@itx.no are



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

only message in thread, other threads:[~2026-10-13 22:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 22:03 [to-be-updated] fs-proc-task_mmu-fix-lost-maps-entries-above-263.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.