Skip to contentSkip to conversation

vmalloc-fix-null-pointer-dereference-in-is_vm_area_hugepages.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 9

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: vmalloc: fix NULL pointer dereference in is_vm_area_hugepages()
has been removed from the -mm tree. Its filename was
vmalloc-fix-null-pointer-dereference-in-is_vm_area_hugepages.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: Hui Zhu <[email protected]>
Subject: vmalloc: fix NULL pointer dereference in is_vm_area_hugepages()
Date: Fri, 29 May 2026 09:41:30 +0800

find_vm_area() can return NULL if the given address is not a valid vmalloc area. Check the return value before dereferencing it to avoid a kernel crash.

Fixes 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings")
Cc Nicholas Piggin <[email protected]>

---

 include/linux/vmalloc.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/vmalloc.h renamed from include/linux/vmalloc.h~vmalloc-fix-null-pointer-dereference-in-is_vm_area_hugepages +3 -1
@@ -265,7 +265,9 @@ static inline bool is_vm_area_hugepages(
 	 * allocated in the vmalloc layer.
 	 */
 #ifdef CONFIG_HAVE_ARCH_HUGE_VMALLOC
-	return find_vm_area(addr)->page_order > 0;
+	struct vm_struct *area = find_vm_area(addr);
+
+	return area && area->page_order > 0;
 #else
 	return false;
 #endif

_

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