can: j1939: j1939_can_recv(): ignore messages with invalid source address
authorZhang Changzhong <zhangchangzhong@huawei.com>
Thu, 28 Oct 2021 14:38:26 +0000 (22:38 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 6 Nov 2021 16:29:24 +0000 (17:29 +0100)
commita79305e156db3d24fcd8eb649cdb3c3b2350e5c2
treedfa72eff682fe57d5bf1892986b557b64361903e
parentc0f49d98006f2db3333b917caac65bce2af9865c
can: j1939: j1939_can_recv(): ignore messages with invalid source address

According to SAE-J1939-82 2015 (A.3.6 Row 2), a receiver should never
send TP.CM_CTS to the global address, so we can add a check in
j1939_can_recv() to drop messages with invalid source address.

Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Link: https://lore.kernel.org/all/1635431907-15617-3-git-send-email-zhangchangzhong@huawei.com
Cc: stable@vger.kernel.org
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/j1939/main.c