Skip to contentSkip to conversation

mm-vmalloc-bail-out-early-on-invalid-page_shift-in-__vmap_pages_range_noflush.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 24

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/vmalloc: bail out early on invalid page_shift in __vmap_pages_range_noflush()
has been removed from the -mm tree. Its filename was
mm-vmalloc-bail-out-early-on-invalid-page_shift-in-__vmap_pages_range_noflush.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: Wen Jiang <[email protected]>
Subject: mm/vmalloc: bail out early on invalid page_shift in __vmap_pages_range_noflush()
Date: Sun, 4 Oct 2026 15:16:39 +0800

__vmap_pages_range_noflush() currently only warns when page_shift is smaller than PAGE_SHIFT, then continues with the invalid shift. Return -EINVAL instead so the bogus argument is caught immediately.

---

 mm/vmalloc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/vmalloc.c renamed from mm/vmalloc.c~mm-vmalloc-bail-out-early-on-invalid-page_shift-in-__vmap_pages_range_noflush +2 -1
@@ -684,7 +684,8 @@ int __vmap_pages_range_noflush(unsigned
 {
 	unsigned int i, nr = (end - addr) >> PAGE_SHIFT;
 
-	WARN_ON(page_shift < PAGE_SHIFT);
+	if (WARN_ON_ONCE(page_shift < PAGE_SHIFT))
+		return -EINVAL;
 
 	if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMALLOC) ||
 			page_shift == PAGE_SHIFT)

_

Patches currently in -mm which might be from [email protected] are