提交 9210807c 编写于 作者: N Nicolas Pitre 提交者: Russell King

[ARM] prevent the vmalloc cmdline argument from eating all memory

Commit 8d5796d2 allows for the vmalloc
area to be resized from the kernel cmdline.  Make sure it cannot overlap
with RAM entirely.
Signed-off-by: NNicolas Pitre <nico@marvell.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 6db015e4
...@@ -646,6 +646,13 @@ static void __init early_vmalloc(char **arg) ...@@ -646,6 +646,13 @@ static void __init early_vmalloc(char **arg)
"vmalloc area too small, limiting to %luMB\n", "vmalloc area too small, limiting to %luMB\n",
vmalloc_reserve >> 20); vmalloc_reserve >> 20);
} }
if (vmalloc_reserve > VMALLOC_END - (PAGE_OFFSET + SZ_32M)) {
vmalloc_reserve = VMALLOC_END - (PAGE_OFFSET + SZ_32M);
printk(KERN_WARNING
"vmalloc area is too big, limiting to %luMB\n",
vmalloc_reserve >> 20);
}
} }
__early_param("vmalloc=", early_vmalloc); __early_param("vmalloc=", early_vmalloc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册