linux-stable/net/can
Oliver Hartkopp 576f474fb2 can: bcm: check timer values before ktime conversion
commit 93171ba6f1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-31 08:14:39 +01:00
..
af_can.c net: Drop pernet_operations::async 2018-03-27 13:18:09 -04:00
af_can.h can: af_can: give struct holding the CAN per device receive lists a sensible name 2018-01-05 11:12:08 +01:00
bcm.c can: bcm: check timer values before ktime conversion 2019-01-31 08:14:39 +01:00
gw.c can: gw: ensure DLC boundaries after CAN frame modification 2019-01-22 21:40:28 +01:00
Kconfig can: migrate documentation to restructured text 2018-01-26 10:46:44 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c proc: introduce proc_create_net_single 2018-05-16 07:24:30 +02:00
raw.c can: raw: check for CAN FD capable netdev in raw_sendmsg() 2018-12-01 09:37:30 +01:00