]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: can: j1939: j1939_xtp_rx_rts_session_active(): deactivate session upon receiving...
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tue, 13 Jan 2026 15:28:47 +0000 (00:28 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:21:24 +0000 (11:21 +0100)
commit6121b7564c725b632ffe4764abe85aa239d37703
tree7144a0406e4448c31ff0a594ea8c0774a3555a77
parentd922e7c5bb6424ea3b2c27d628af3cbbfb786d17
net: can: j1939: j1939_xtp_rx_rts_session_active(): deactivate session upon receiving the second rts

commit 1809c82aa073a11b7d335ae932d81ce51a588a4a upstream.

Since j1939_session_deactivate_activate_next() in j1939_tp_rxtimer() is
called only when the timer is enabled, we need to call
j1939_session_deactivate_activate_next() if we cancelled the timer.
Otherwise, refcount for j1939_session leaks, which will later appear as

| unregister_netdevice: waiting for vcan0 to become free. Usage count = 2.

problem.

Reported-by: syzbot <syzbot+881d65229ca4f9ae8c84@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=881d65229ca4f9ae8c84
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Link: https://patch.msgid.link/b1212653-8fa1-44e1-be9d-12f950fb3a07@I-love.SAKURA.ne.jp
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/can/j1939/transport.c