lkml.org 
[lkml]   [2011]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] x86: fix panic when handling "mem={invalid}" param
Date
Avoid removing all of memory and panicing when "mem={invalid}" is
specified, e.g. mem=blahblah, mem=0, or mem=nopentium (on platforms
other than x86_32).

BugLink: http://bugs.launchpad.net/bugs/553464
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Cc: <stable@kernel.org>
---
arch/x86/kernel/e820.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 294f26d..55a59d8 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -856,6 +856,9 @@ static int __init parse_memopt(char *p)

userdef = 1;
mem_size = memparse(p, &p);
+ /* don't remove all of memory when handling "mem={invalid}" param */
+ if (mem_size == 0)
+ return -EINVAL;
e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);

return 0;
--
1.7.1


\
 
 \ /
  Last update: 2011-02-04 02:47    [W:0.054 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site