diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2019-01-13 19:31:43 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-01-22 11:33:46 +0100 |
commit | 93171ba6f1deffd82f381d36cb13177872d023f6 (patch) | |
tree | 5f561038080d2b31941a39fec548e60edfc28e4c /drivers/net/can/flexcan.c | |
parent | 7b12c8189a3dc50638e7d53714c88007268d47ef (diff) | |
download | lwn-93171ba6f1deffd82f381d36cb13177872d023f6.tar.gz lwn-93171ba6f1deffd82f381d36cb13177872d023f6.zip |
can: bcm: check timer values before ktime conversion
Kyungtae Kim detected a potential integer overflow in bcm_[rx|tx]_setup()
when the conversion into ktime multiplies the given value with NSEC_PER_USEC
(1000).
Reference: https://marc.info/?l=linux-can&m=154732118819828&w=2
Add a check for the given tv_usec, so that the value stays below one second.
Additionally limit the tv_sec value to a reasonable value for CAN related
use-cases of 400 days and ensure all values to be positive.
Reported-by: Kyungtae Kim <kt0755@gmail.com>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-stable <stable@vger.kernel.org> # >= 2.6.26
Tested-by: Kyungtae Kim <kt0755@gmail.com>
Acked-by: Andre Naujoks <nautsch2@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/flexcan.c')
0 files changed, 0 insertions, 0 deletions