]> git.baikalelectronics.ru Git - kernel.git/commit
can: isotp: sanitize CAN ID checks in isotp_bind()
authorOliver Hartkopp <socketcan@hartkopp.net>
Wed, 16 Mar 2022 16:42:56 +0000 (17:42 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 16 Mar 2022 20:41:39 +0000 (21:41 +0100)
commit0d7a4a9ad3db57d8b1b1673df7319199fbfc916a
tree47d0a5d794657e7ac2c30b6e7ca7449b667e0db9
parent83044fdde425ef4726de6c979660ef461e5bf1a1
can: isotp: sanitize CAN ID checks in isotp_bind()

Syzbot created an environment that lead to a state machine status that
can not be reached with a compliant CAN ID address configuration.
The provided address information consisted of CAN ID 0x6000001 and 0xC28001
which both boil down to 11 bit CAN IDs 0x001 in sending and receiving.

Sanitize the SFF/EFF CAN ID values before performing the address checks.

Fixes: 3f9425168a78 ("can: add ISO 15765-2:2016 transport protocol")
Link: https://lore.kernel.org/all/20220316164258.54155-1-socketcan@hartkopp.net
Reported-by: syzbot+2339c27f5c66c652843e@syzkaller.appspotmail.com
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/isotp.c