linux/net/can
Tetsuo Handa adabf01c19 net: can: j1939: j1939_xtp_rx_rts_session_active(): deactivate session upon receiving the second rts
commit 1809c82aa0 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: 9d71dd0c70 ("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>
History 2026-02-06 16:41:47 +01:00
..
j1939 net: can: j1939: j1939_xtp_rx_rts_session_active(): deactivate session upon receiving the second rts 2026-02-06 16:41:47 +01:00
af_can.c can: statistics: use atomic access in hot path 2025-04-10 14:32:03 +02:00
af_can.h can: statistics: use atomic access in hot path 2025-04-10 14:32:03 +02:00
bcm.c can: bcm: add missing rcu read protection for procfs content 2025-06-04 14:38:06 +02:00
gw.c can: gw: fix RCU/BH usage in cgw_create_job() 2025-05-18 08:20:35 +02:00
isotp.c can: isotp: isotp_sendmsg(): fix TX state detection and wait behavior 2023-11-08 17:26:49 +01:00
Kconfig net: remove redundant 'depends on NET' 2021-01-27 17:04:12 -08:00
Makefile can: add ISO 15765-2:2016 transport protocol 2020-10-07 23:18:33 +02:00
proc.c can: statistics: use atomic access in hot path 2025-04-10 14:32:03 +02:00
raw.c can: raw: add support for SO_MARK 2024-01-15 18:51:14 +01:00