Commit 48d97cb6 authored by Rene Herman's avatar Rene Herman Committed by Ingo Molnar

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: default avatarCyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarRene Herman <rene.herman@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent b0fbaa6b
......@@ -1720,12 +1720,16 @@ static int __init parse_lapic_timer_c2_ok(char *arg)
}
early_param("lapic_timer_c2_ok", parse_lapic_timer_c2_ok);
static int __init apic_set_verbosity(char *str)
static int __init apic_set_verbosity(char *arg)
{
if (strcmp("debug", str) == 0)
if (!arg)
return -EINVAL;
if (strcmp(arg, "debug") == 0)
apic_verbosity = APIC_DEBUG;
else if (strcmp("verbose", str) == 0)
else if (strcmp(arg, "verbose") == 0)
apic_verbosity = APIC_VERBOSE;
return 0;
}
early_param("apic", apic_set_verbosity);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment