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>
This commit is contained in:
Родитель
6a55617ed5
Коммит
ee974e01e5
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче