diff options
author | Mathias Krause <minipli@googlemail.com> | 2013-02-19 14:47:07 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-02-20 05:24:36 -0500 |
commit | 27cf929845b10043f2257693c7d179a9e0b1980e (patch) | |
tree | 2482f628f968f05c18dda63dc09c16825d0d24ab /arch | |
parent | ece8e0b2f9c980e5511fe8db2d68c6f1859b9d83 (diff) |
x86/apic: Fix parsing of the 'lapic' cmdline option
Including " lapic " in the kernel cmdline on an x86-64 kernel
makes it panic while parsing early params -- e.g. with no user
visible output.
Fix this bug by ensuring arg is non-NULL before passing it to
strncmp().
Reported-by: PaX Team <pageexec@freemail.hu>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/1361303227-13174-1-git-send-email-minipli@googlemail.com
Cc: stable@vger.kernel.org # v3.8
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index a5b4dce1b7ac..904611bf0e5a 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -131,7 +131,7 @@ static int __init parse_lapic(char *arg) | |||
131 | { | 131 | { |
132 | if (config_enabled(CONFIG_X86_32) && !arg) | 132 | if (config_enabled(CONFIG_X86_32) && !arg) |
133 | force_enable_local_apic = 1; | 133 | force_enable_local_apic = 1; |
134 | else if (!strncmp(arg, "notscdeadline", 13)) | 134 | else if (arg && !strncmp(arg, "notscdeadline", 13)) |
135 | setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); | 135 | setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |