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-04-26 16:32:11 -07:00
2021-06-04 07:37:49 -07:00
2021-04-27 14:10:15 -07:00
2021-04-30 13:04:30 -07:00
2021-05-05 12:39:29 -07:00
2021-04-28 15:59:13 -07:00
2021-06-09 17:20:03 -07:00
2021-05-03 23:04:01 +02:00
2021-05-07 14:49:18 -07:00
2021-05-21 06:12:52 -10:00
2021-05-18 17:24:52 +01:00
2021-05-07 11:23:41 -07:00
2021-05-19 15:24:52 +02:00
2021-04-29 11:57:23 -07:00
2021-05-06 19:24:11 -07:00
2021-05-07 00:26:33 -07:00
2021-05-08 21:49:48 -06:00
2021-05-07 00:34:51 -07:00
2021-05-06 19:24:12 -07:00
2021-05-22 15:09:07 -10:00
2021-05-15 08:52:30 -07:00
2021-05-03 11:56:23 +02:00
2021-04-29 11:57:23 -07:00
2021-05-05 11:27:24 -07:00
2021-05-24 12:45:26 -04:00
2021-05-24 12:45:26 -04:00
2021-05-01 10:14:08 -07:00
2021-05-05 11:27:24 -07:00
2021-05-05 11:27:24 -07:00
2021-05-21 06:12:52 -10:00
2021-04-30 11:20:35 -07:00
2021-05-07 00:26:34 -07:00
2021-05-13 11:00:18 -07:00
2021-05-22 15:09:07 -10:00
2021-05-05 22:54:12 +02:00
2021-05-04 11:24:46 -07:00
2021-04-29 11:41:43 -07:00
2021-05-06 19:24:12 -07:00
2021-05-06 19:24:11 -07:00
2021-05-07 00:26:32 -07:00
2021-05-13 20:50:23 +02:00
2021-05-11 08:12:14 -06:00
2021-05-07 00:26:34 -07:00
2021-05-10 16:22:27 +02:00
2021-05-20 07:59:35 -06:00
2021-05-07 00:26:34 -07:00
2021-05-07 00:26:34 -07:00
2021-05-07 00:26:33 -07:00
2021-04-29 21:44:07 +02:00
2021-05-05 11:27:27 -07:00
2021-05-05 11:27:21 -07:00
2021-05-05 11:27:22 -07:00
2021-04-28 17:22:10 -07:00
2021-05-06 19:24:11 -07:00
2021-05-07 00:26:33 -07:00
2021-04-30 11:20:39 -07:00
2021-04-30 11:20:40 -07:00
2021-05-04 08:54:29 -07:00
2021-05-05 12:39:29 -07:00
2021-04-30 11:20:41 -07:00
2021-05-09 00:29:45 +09:00
2021-05-08 10:00:11 -07:00
2021-05-05 22:54:12 +02:00
2021-05-12 12:37:14 -07:00
2021-04-28 12:37:53 -07:00
2021-05-01 18:50:44 -07:00
2021-05-01 18:50:44 -07:00
2021-04-27 14:13:24 -07:00
2021-05-05 11:27:23 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2021-05-05 11:27:26 -07:00
2021-05-22 15:09:07 -10:00
2021-05-14 19:41:32 -07:00
2021-05-14 19:41:32 -07:00
2021-05-07 00:26:33 -07:00
2021-05-07 11:23:41 -07:00
2021-04-30 11:20:42 -07:00
2021-05-14 19:41:32 -07:00
2021-04-30 11:20:41 -07:00
2021-05-05 13:24:11 -07:00
2021-05-01 10:14:08 -07:00
2021-05-07 00:26:34 -07:00
2021-05-26 13:15:55 -07:00
2021-05-10 19:14:01 +02:00
2021-04-28 15:43:58 -07:00
2021-05-06 19:24:11 -07:00
2021-05-06 19:24:11 -07:00
2021-06-15 10:59:46 -07:00
2021-05-11 09:56:11 +02:00
2021-04-28 12:00:13 -07:00
2021-05-05 13:24:11 -07:00
2021-05-05 11:27:26 -07:00
2021-05-01 18:50:44 -07:00
2021-04-27 15:50:15 -07:00
2021-05-05 11:27:23 -07:00
2021-05-21 06:12:52 -10:00
2021-05-09 13:07:03 -07:00
2021-06-12 13:13:08 -07:00
2021-04-28 12:37:53 -07:00
2021-05-06 19:24:11 -07:00
2021-05-01 18:50:44 -07:00
2021-04-29 11:06:13 -07:00
2021-05-05 11:27:22 -07:00
2021-05-03 04:55:53 -04:00
2021-05-04 04:19:59 -04:00
2021-05-05 11:27:25 -07:00
2021-05-07 00:26:35 -07:00
2021-04-30 11:20:37 -07:00
2021-05-03 04:55:53 -04:00
2021-05-05 22:54:11 +02:00