vmalloc-fix-buffer-overflow-in-vrealloc_node_align.patch removed from -mm tree
The quilt patch titled
Subject: vmalloc: fix buffer overflow in vrealloc_node_align()
has been removed from the -mm tree. Its filename was
vmalloc-fix-buffer-overflow-in-vrealloc_node_align.patch
This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Marco Elver <[email protected]>
Subject: vmalloc: fix buffer overflow in vrealloc_node_align()
Date: Mon, 20 Apr 2026 13:47:26 +0200
Commit 4c5d3365882d ("mm/vmalloc: allow to set node and align in vrealloc") added the ability to force a new allocation if the current pointer is on the wrong NUMA node, or if an alignment constraint is not met, even if the user is shrinking the allocation.
On this path (need_realloc), the code allocates a new object of 'size' bytes and then memcpy()s 'old_size' bytes into it. If the request is to shrink the object (size < old_size), this results in an out-of-bounds write on the new buffer.
Fix this by bounding the copy length by the new allocation size.
---
mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/vmalloc.c renamed from mm/vmalloc.c~vmalloc-fix-buffer-overflow-in-vrealloc_node_align +1 -1
@@ -4361,7 +4361,7 @@ need_realloc:return NULL ;if (p) { -memcpy (n, p, old_size); +memcpy (n, p,min (size, old_size));vfree (p); }
_
Patches currently in -mm which might be from [email protected] are