Re: [PATCH] bootmem: avoid freeing to bootmem after bootmem is done

From: Mel Gorman
Date: Mon Jul 27 2015 - 07:00:04 EST


On Fri, Jul 24, 2015 at 04:53:46PM -0400, Chris Metcalf wrote:
> Bootmem isn't popular any more, but some architectures still use
> it, and freeing to bootmem after calling free_all_bootmem_core()
> can end up scribbling over random memory. Instead, make sure the
> kernel panics by ensuring the node_bootmem_map field is non-NULL
> when are freeing or marking bootmem.
>
> An instance of this bug was just fixed in the tile architecture
> ("tile: use free_bootmem_late() for initrd") and catching this case
> more widely seems like a good thing.
>
> Signed-off-by: Chris Metcalf <cmetcalf@xxxxxxxxxx>

In general it looks fine but you could just WARN_ON, return and still
boot the kernel too. Obviously it would need to be fixed but Linus will
push back if he spots a BUG_ON when there was a recovery option.

--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/