Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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;