Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752076AbbG0K76 (ORCPT ); Mon, 27 Jul 2015 06:59:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:41692 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751261AbbG0K75 (ORCPT ); Mon, 27 Jul 2015 06:59:57 -0400 Date: Mon, 27 Jul 2015 11:59:51 +0100 From: Mel Gorman To: Chris Metcalf Cc: Andrew Morton , Yasuaki Ishimatsu , Pekka Enberg , Paul McQuade , Tang Chen , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bootmem: avoid freeing to bootmem after bootmem is done Message-ID: <20150727105951.GO2561@suse.de> References: <1437771226-31255-1-git-send-email-cmetcalf@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1437771226-31255-1-git-send-email-cmetcalf@ezchip.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 25 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 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/