[lkml]   [2017]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.4 49/59] MIPS: init: Ensure reserved memory regions are not added to bootmem
4.4-stable review patch.  If anyone has any objections, please let me know.


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 <>
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)
/* Not usable memory */
+ if (start > min_low_pfn && end < max_low_pfn)
+ reserve_bootmem([i].addr,

 \ /
  Last update: 2017-11-19 15:39    [W:0.210 / U:2.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site