From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42566 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbdKSLGo (ORCPT ); Sun, 19 Nov 2017 06:06:44 -0500 Subject: Patch "MIPS: init: Ensure reserved memory regions are not added to bootmem" has been added to the 4.4-stable tree To: marcin.nowakowski@imgtec.com, alexander.levin@verizon.com, gregkh@linuxfoundation.org, ralf@linux-mips.org Cc: , From: Date: Sun, 19 Nov 2017 12:06:05 +0100 Message-ID: <151108956511244@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled MIPS: init: Ensure reserved memory regions are not added to bootmem to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Sun Nov 19 12:02:55 CET 2017 From: Marcin Nowakowski Date: Wed, 23 Nov 2016 14:43:44 +0100 Subject: MIPS: init: Ensure reserved memory regions are not added to bootmem From: Marcin Nowakowski [ Upstream commit e89ef66d7682f031f026eee6bba03c8c2248d2a9 ] Memories managed through boot_mem_map are generally expected to define non-crossing areas. However, if part of a larger memory block is marked as reserved, it would still be added to bootmem allocator as an available block and could end up being overwritten by the allocator. Prevent this by explicitly marking the memory as reserved it if exists in the range used by bootmem allocator. Signed-off-by: Marcin Nowakowski Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14608/ Signed-off-by: Ralf Baechle Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/setup.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -506,6 +506,10 @@ static void __init bootmem_init(void) continue; default: /* Not usable memory */ + if (start > min_low_pfn && end < max_low_pfn) + reserve_bootmem(boot_mem_map.map[i].addr, + boot_mem_map.map[i].size, + BOOTMEM_DEFAULT); continue; } Patches currently in stable-queue which might be from marcin.nowakowski@imgtec.com are queue-4.4/mips-init-ensure-bootmem-does-not-corrupt-reserved-memory.patch queue-4.4/mips-init-ensure-reserved-memory-regions-are-not-added-to-bootmem.patch