Skip to content

Commit

Permalink
clocksource: check range
Browse files Browse the repository at this point in the history
Check that the value being passed to parse_pmtmr() does not exceed the
limits of pmtmr_ioport.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
dhowells authored and Ingo Molnar committed Aug 21, 2008
1 parent 6a55617 commit ee974e0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/clocksource/acpi_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@ static int __init parse_pmtmr(char *arg)

if (strict_strtoul(arg, 16, &base))
return -EINVAL;

#ifdef CONFIG_X86_64
if (base > UINT_MAX)
return -ERANGE;
#endif
printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
(unsigned int)pmtmr_ioport, base);
pmtmr_ioport, base);
pmtmr_ioport = base;

return 1;
Expand Down

0 comments on commit ee974e0

Please sign in to comment.