aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorRene Herman <rene.herman@keyaccess.nl>2008-08-11 13:20:17 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-11 13:40:38 -0400
commit48d97cb65e62a5f1122ac2cf1149800d4f4693e8 (patch)
tree20f9ccaeeb89eebec0444fb3eb45ebaa6f2c3525 /arch/x86
parentb0fbaa6b5976962434349849673b9ff63631b6d4 (diff)
x86: make "apic" an early_param() on 32-bit, NULL check
Cyrill Gorcunov observed: > you turned it into early_param so now it's NULL injecting vulnerabled. > Could you please add checking for NULL str param? fix that. Also, change the name of 'str' into 'arg', to make it more apparent that this is an optional argument that can be NULL, not a string parameter that is empty when unset. Reported-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Rene Herman <rene.herman@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/apic_32.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index f432d4833a12..039a8d4aaf62 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1720,12 +1720,16 @@ static int __init parse_lapic_timer_c2_ok(char *arg)
1720} 1720}
1721early_param("lapic_timer_c2_ok", parse_lapic_timer_c2_ok); 1721early_param("lapic_timer_c2_ok", parse_lapic_timer_c2_ok);
1722 1722
1723static int __init apic_set_verbosity(char *str) 1723static int __init apic_set_verbosity(char *arg)
1724{ 1724{
1725 if (strcmp("debug", str) == 0) 1725 if (!arg)
1726 return -EINVAL;
1727
1728 if (strcmp(arg, "debug") == 0)
1726 apic_verbosity = APIC_DEBUG; 1729 apic_verbosity = APIC_DEBUG;
1727 else if (strcmp("verbose", str) == 0) 1730 else if (strcmp(arg, "verbose") == 0)
1728 apic_verbosity = APIC_VERBOSE; 1731 apic_verbosity = APIC_VERBOSE;
1732
1729 return 0; 1733 return 0;
1730} 1734}
1731early_param("apic", apic_set_verbosity); 1735early_param("apic", apic_set_verbosity);