diff options
author | Baoquan He <bhe@redhat.com> | 2017-05-13 07:46:28 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-05-24 09:50:27 +0200 |
commit | d52e7d5a952c5e35783f96e8c5b7fcffbb0d7c60 (patch) | |
tree | 4c8b6c1df9e5032f71a9f79b1f573774f690d766 /arch/x86/boot/compressed/cmdline.c | |
parent | Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
download | linux-d52e7d5a952c5e35783f96e8c5b7fcffbb0d7c60.tar.xz linux-d52e7d5a952c5e35783f96e8c5b7fcffbb0d7c60.zip |
x86/KASLR: Parse all 'memmap=' boot option entries
In commit:
f28442497b5c ("x86/boot: Fix KASLR and memmap= collision")
... the memmap= option is parsed so that KASLR can avoid those reserved
regions. It uses cmdline_find_option() to get the value if memmap=
is specified, however the problem is that cmdline_find_option() can only
find the last entry if multiple memmap entries are provided. This
is not correct.
Address this by checking each command line token for a "memmap=" match
and parse each instance instead of using cmdline_find_option().
Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dan.j.williams@intel.com
Cc: douly.fnst@cn.fujitsu.com
Cc: dyoung@redhat.com
Cc: m.mizuma@jp.fujitsu.com
Link: http://lkml.kernel.org/r/1494654390-23861-2-git-send-email-bhe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/boot/compressed/cmdline.c')
-rw-r--r-- | arch/x86/boot/compressed/cmdline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/boot/compressed/cmdline.c b/arch/x86/boot/compressed/cmdline.c index 73ccf63b0f48..9dc1ce6ba3c0 100644 --- a/arch/x86/boot/compressed/cmdline.c +++ b/arch/x86/boot/compressed/cmdline.c @@ -13,7 +13,7 @@ static inline char rdfs8(addr_t addr) return *((char *)(fs + addr)); } #include "../cmdline.c" -static unsigned long get_cmd_line_ptr(void) +unsigned long get_cmd_line_ptr(void) { unsigned long cmd_line_ptr = boot_params->hdr.cmd_line_ptr; |