can: j1939: socket: rework socket locking for j1939_sk_release() and j1939_sk_sendmsg()
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 5 Nov 2019 13:31:58 +0000 (14:31 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 13 Nov 2019 09:42:34 +0000 (10:42 +0100)
commitfd81ebfe7975b9a69494430676d16f7125aac3ee
treef091a4e9ed825031f5a33489547b0fc7c22e9778
parentc48c8c1e2e81e71a0f13b83cc5124333f3750064
can: j1939: socket: rework socket locking for j1939_sk_release() and j1939_sk_sendmsg()

j1939_sk_sendmsg() should be protected by lock_sock() to avoid race with
j1939_sk_bind() and j1939_sk_release().

Reported-by: syzbot+afd421337a736d6c1ee6@syzkaller.appspotmail.com
Reported-by: syzbot+6d04f6a1b31a0ae12ca9@syzkaller.appspotmail.com
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
net/can/j1939/socket.c