lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1377841673-17361-1-git-send-email-bob.liu@oracle.com>
Date:	Fri, 30 Aug 2013 13:47:53 +0800
From:	Bob Liu <lliubbo@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	akpm@...ux-foundation.org, hpa@...ux.intel.com, yinghai@...nel.org,
	jacob.shin@....com, konrad.wilk@...cle.com, linux-mm@...ck.org,
	Bob Liu <bob.liu@...cle.com>
Subject: [PATCH] x86: e820: fix memmap kernel boot parameter

Kernel boot parameter memmap=nn[KMG]$ss[KMG] is used to mark specific memory as
reserved. Region of memory to be used is from ss to ss+nn.

But I found the action of this parameter is not as expected.
I tried on two machines.
Machine1: bootcmdline in grub.cfg "memmap=800M$0x60bfdfff", but the result of
"cat /proc/cmdline" changed to "memmap=800M/bin/bashx60bfdfff" after system
booted.

Machine2: bootcmdline in grub.cfg "memmap=0x77ffffff$0x880000000", the result of
"cat /proc/cmdline" changed to "memmap=0x77ffffffx880000000".

I didn't find the root cause, I think maybe grub reserved "$0" as something
special.
Replace '$' with '%' in kernel boot parameter can fix this issue.

Signed-off-by: Bob Liu <bob.liu@...cle.com>
---
 Documentation/kernel-parameters.txt |    6 +++---
 arch/x86/kernel/e820.c              |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 7f9d4f5..a96c7b1 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1604,13 +1604,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			[KNL,ACPI] Mark specific memory as ACPI data.
 			Region of memory to be used, from ss to ss+nn.
 
-	memmap=nn[KMG]$ss[KMG]
+	memmap=nn[KMG]%ss[KMG]
 			[KNL,ACPI] Mark specific memory as reserved.
 			Region of memory to be used, from ss to ss+nn.
 			Example: Exclude memory from 0x18690000-0x1869ffff
-			         memmap=64K$0x18690000
+			         memmap=64K%0x18690000
 			         or
-			         memmap=0x10000$0x18690000
+			         memmap=0x10000%0x18690000
 
 	memory_corruption_check=0/1 [X86]
 			Some BIOSes seem to corrupt the first 64k of
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index d32abea..8483d45 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -869,7 +869,7 @@ static int __init parse_memmap_one(char *p)
 	} else if (*p == '#') {
 		start_at = memparse(p+1, &p);
 		e820_add_region(start_at, mem_size, E820_ACPI);
-	} else if (*p == '$') {
+	} else if (*p == '%') {
 		start_at = memparse(p+1, &p);
 		e820_add_region(start_at, mem_size, E820_RESERVED);
 	} else
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ