mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v8 0/4] can: j1939: fix the abort timer and bound EDPO
@ 2026-11-11  7:20 Chaosheng Qu
  0 siblings, 0 replies; only message in thread
From: Chaosheng Qu @ 2026-11-11  7:20 UTC (permalink / raw)
  To: Robin van der Gracht, Oleksij Rempel, Oliver Hartkopp, Marc Kleine-Budde
  Cc: kernel, linux-can, linux-kernel

v8 addresses the three findings from the sashiko review of v7.

1/4 is rewritten.  The v7 version cancelled the receive timer before
taking active_session_list_lock and started it again under the lock, so
two concurrent callers could both reach hrtimer_start(): the second one
reprograms an already armed timer and the reference taken for the first
arm is never dropped, leaking the session and its netdev reference.  The
new j1939_tp_arm_rxtimer_locked() uses hrtimer_try_to_cancel(), which
never waits for a running callback, so the cancel and the start happen
together under the lock.  j1939_tp_set_rxtimeout() and the rx timeout
branch of j1939_tp_rxtimer() use the same helper, so there is one arming
path instead of three.

2/4 now calls j1939_session_timers_cancel() before aborting on an
out-of-range EDPO, as the other receive-path abort handlers do.
j1939_session_cancel() only rearms the abort timer, so the transmit timer
stayed armed on an aborting session: on the transmitter path the retries
kept firing until J1939_XTP_TX_RETRY_LIMIT and overwrote session->err with
-ENETUNREACH, on the receiver path they sent CTS or EOMA and clobbered the
abort timeout.  It also carries the Fixes tag for the NULL dereference.

3/4 and 4/4 are unchanged from v7.


Chaosheng Qu (4):
  can: j1939: serialize cancel and rearm of the receive timer
  can: j1939: validate the EDPO packet number
  can: j1939: drop the message when the reassembled skb is gone
  can: j1939: reject a CTS that names more packets than the message has

 net/can/j1939/transport.c | 119 +++++++++++++++++++++++++++++++-------
 1 file changed, 97 insertions(+), 22 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-11  7:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11  7:20 [PATCH net v8 0/4] can: j1939: fix the abort timer and bound EDPO Chaosheng Qu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®