x86: apic: Fix parsing of lapic cmdline option
diff mbox series

Message ID 1361303227-13174-1-git-send-email-minipli@googlemail.com
State New, archived
Headers show
Series
  • x86: apic: Fix parsing of lapic cmdline option
Related show

Commit Message

Mathias Krause Feb. 19, 2013, 7:47 p.m. UTC
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().

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Reported-by: PaX Team <pageexec@freemail.hu>
Cc: stable@vger.kernel.org	# v3.8
---
 arch/x86/kernel/apic/apic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Rientjes Feb. 19, 2013, 9:04 p.m. UTC | #1
On Tue, 19 Feb 2013, Mathias Krause wrote:

> 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().
> 
> Signed-off-by: Mathias Krause <minipli@googlemail.com>
> Reported-by: PaX Team <pageexec@freemail.hu>
> Cc: stable@vger.kernel.org	# v3.8

Acked-by: David Rientjes <rientjes@google.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index b994cc8..cbf5121 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)
 {
 	if (config_enabled(CONFIG_X86_32) && !arg)
 		force_enable_local_apic = 1;
-	else if (!strncmp(arg, "notscdeadline", 13))
+	else if (arg && !strncmp(arg, "notscdeadline", 13))
 		setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
 	return 0;
 }