Skip to content

Commit

Permalink
x86: make "apic" an early_param() on 32-bit, NULL check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rene Herman authored and Ingo Molnar committed Aug 11, 2008
1 parent b0fbaa6 commit 48d97cb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions arch/x86/kernel/apic_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 48d97cb

Please sign in to comment.