Files
kernel_arpi/include/linux
Jakub Kicinski 475b92f932 ptp: improve max_adj check against unreasonable values
Scaled PPM conversion to PPB may (on 64bit systems) result
in a value larger than s32 can hold (freq/scaled_ppm is a long).
This means the kernel will not correctly reject unreasonably
high ->freq values (e.g. > 4294967295ppb, 281474976645 scaled PPM).

The conversion is equivalent to a division by ~66 (65.536),
so the value of ppb is always smaller than ppm, but not small
enough to assume narrowing the type from long -> s32 is okay.

Note that reasonable user space (e.g. ptp4l) will not use such
high values, anyway, 4289046510ppb ~= 4.3x, so the fix is
somewhat pedantic.

Fixes: d39a743511 ("ptp: validate the requested frequency adjustment.")
Fixes: d94ba80ebb ("ptp: Added a brand new class driver for ptp clocks.")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-15 10:59:46 -07:00
..
2021-05-18 17:24:52 +01:00
2021-05-06 19:24:11 -07:00
2021-04-14 16:30:30 +03:00
2021-05-08 21:49:48 -06:00
2021-04-08 16:04:20 -07:00
2021-05-24 12:45:26 -04:00
2021-05-24 12:45:26 -04:00
2021-04-08 16:04:20 -07:00
2021-04-08 16:04:20 -07:00
2021-05-06 19:24:11 -07:00
2021-04-19 13:13:26 -04:00
2021-04-12 15:04:23 +02:00
2021-03-30 22:37:06 +02:00
2021-05-07 00:26:34 -07:00
2021-04-08 16:04:20 -07:00
2021-04-30 11:20:40 -07:00
2021-04-05 22:39:38 -04:00
2021-05-14 19:41:32 -07:00
2021-04-08 16:04:20 -07:00
2021-04-06 08:34:39 +02:00
2021-04-21 10:24:41 -05:00
2021-05-06 19:24:11 -07:00
2021-04-15 10:32:17 +02:00
2021-03-30 17:06:49 -07:00
2021-04-26 22:55:12 +01:00
2021-04-09 16:00:00 +02:00
2021-05-07 00:26:35 -07:00
2021-04-16 15:31:02 -07:00
2021-03-30 13:42:33 -04:00