Skip to content

Commit ee974e0

Browse files
dhowellsIngo Molnar
authored andcommitted
clocksource: check range
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>
1 parent 6a55617 commit ee974e0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎drivers/clocksource/acpi_pm.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,12 @@ static int __init parse_pmtmr(char *arg)
226226

227227
if (strict_strtoul(arg, 16, &base))
228228
return -EINVAL;
229-
229+
#ifdef CONFIG_X86_64
230+
if (base > UINT_MAX)
231+
return -ERANGE;
232+
#endif
230233
printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
231-
(unsigned int)pmtmr_ioport, base);
234+
pmtmr_ioport, base);
232235
pmtmr_ioport = base;
233236

234237
return 1;

0 commit comments

Comments
 (0)