Commit ee974e01 authored by David Howells's avatar David Howells Committed by Ingo Molnar

clocksource: check range

Check that the value being passed to parse_pmtmr() does not exceed the
limits of pmtmr_ioport.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 6a55617e
...@@ -226,9 +226,12 @@ static int __init parse_pmtmr(char *arg) ...@@ -226,9 +226,12 @@ static int __init parse_pmtmr(char *arg)
if (strict_strtoul(arg, 16, &base)) if (strict_strtoul(arg, 16, &base))
return -EINVAL; return -EINVAL;
#ifdef CONFIG_X86_64
if (base > UINT_MAX)
return -ERANGE;
#endif
printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n", printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
(unsigned int)pmtmr_ioport, base); pmtmr_ioport, base);
pmtmr_ioport = base; pmtmr_ioport = base;
return 1; return 1;
......
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