linux-brain/net/can
Oliver Hartkopp e7126858fc 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:13:46 +01:00
..
af_can.c can: af_can: canfd_rcv(): replace WARN_ONCE by pr_warn_once 2018-01-23 19:58:17 +01:00
af_can.h can: complete initial namespace support 2017-04-25 09:04:29 +02:00
bcm.c can: bcm: check timer values before ktime conversion 2019-01-31 08:13:46 +01:00
gw.c can: gw: ensure DLC boundaries after CAN frame modification 2019-01-23 08:09:46 +01:00
Kconfig can: Kconfig: switch on all CAN protocolls by default 2013-01-26 16:58:58 +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 can: complete initial namespace support 2017-04-25 09:04:29 +02:00
raw.c can: raw: check for CAN FD capable netdev in raw_sendmsg() 2018-12-01 09:42:52 +01:00