History

Merge tag 'fixes-2024-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock

Pull memblock fix from Mike Rapoport: "Fix crash when reserved memory is not added to memory. When CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, the initialization of reserved pages may cause access of NODE_DATA() with invalid nid and crash. Add a fall back to early_pfn_to_nid() in memmap_init_reserved_pages() to ensure a valid node id is always passed to init_reserved_page()" * tag 'fixes-2024-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: fix crash when reserved memory is not added to memory

Linus Torvalds committed 2 years ago

Commit a08ebda2 parents 8a696a2 6a9531c1 file · +3 −0Browse files

Unified · Split

mm/memblock.c+3−0
@@ -2176,6 +2176,9 @@ static void __init memmap_init_reserved_pages(void) · 2175 unmodified lines
21762176 start = region->base;
21772177 end = start + region->size;
21782178
2179+ if (nid == NUMA_NO_NODE || nid >= MAX_NUMNODES)
2180+ nid = early_pfn_to_nid(PFN_DOWN(start));
2181+
21792182 reserve_bootmem_region(start, end, nid);
21802183 }
21812184 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t