mm/large system hash: avoid possible NULL deref in alloc_large_system_hash
Subsystems (2)
PATCH 1/1 mm/large system hash: avoid possible NULL deref in alloc_large_system_hash
From: Eric Dumazet <[email protected]>
If __vmalloc() returned NULL, is_vm_area_hugepages(NULL) will fault if CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
Fixes 121e6f3258fe ("mm/vmalloc: hugepage vmalloc mappings")
Signed-off-by Eric Dumazet <[email protected]>
Cc Nicholas Piggin <[email protected]>
--- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
mm/page_alloc.c +2 -1
@@ -8756,7 +8756,8 @@ void *__init alloc_large_system_hash(const char *tablename, }else if (get_order (size) >=MAX_ORDER || hashdist) { table =__vmalloc (size, gfp_flags); virt = true; - huge =is_vm_area_hugepages (table); +if (table) + huge =is_vm_area_hugepages (table); }else {/* * If bucketsize is not a power-of-two, we may free
Signature · 1 line
2.33.0.309.g3052b89438-goog