On Wed, May 13, 2026 at 09:04:34PM +0800, Muchun Song wrote: > When vmemmap or usemap allocation fails, sparse_init_nid() currently > marks the section non-present and continues. Later boot-time code can > still walk PFNs in that section without checking for this partial setup, > which leads to invalid accesses. subsection_map_init() can also touch an > unallocated usemap. > > Auditing and fixing all early PFN walkers for this case is not worth the > complexity. These allocation failures are expected to be fatal anyway, > and other memory models already treat them that way. > > Make memmap and usemap allocation failures panic immediately instead of > trying to recover and crashing later in less obvious ways. This is also > consistent with how other memory model configurations handle memmap > allocation failures. > > Signed-off-by: Muchun Song <[email protected]> > Acked-by: Mike Rapoport (Microsoft) <[email protected]>
Yes, one could argue that if we fail to allocate memory at that early stage we are already screwed. Acked-by: Oscar Salvador <[email protected]> -- Oscar Salvador SUSE Labs
