From: Chaosheng Qu <quchaosheng000406@163.com>
To: netdev-bot+sashiko@kernel.org
Cc: Robin van der Gracht <robin@protonic.nl>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Oliver Hartkopp <socketcan@hartkopp.net>,
Marc Kleine-Budde <mkl@pengutronix.de>,
kernel@pengutronix.de, linux-can@vger.kernel.org,
linux-kernel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net v7 1/4] can: j1939: arm the abort timer under the session list lock
Date: Fri, 13 Nov 2026 11:11:13 +0800 [thread overview]
Message-ID: <179453947397.30993.11677929413398880016@163.com> (raw)
In-Reply-To: <179452017919.488853.15478724062923628521@kernel.org>
Hi,
1/4 was rewritten in v8 and v9 is current, but both High findings were real
in v7 as posted.
The commit message claim was wrong. Only j1939_session_cancel() took
active_session_list_lock; j1939_tp_set_rxtimeout() still did cancel, get and
start without it, so the lock only serialized the cancels against each other.
The double-arm is the same problem, and the WAITING_ABORT re-arm is what made
it reachable: the second caller found the state already changed and armed on
top of the timer the first one had queued. Two gets, one expiry, one put, so
the session and its netdev reference leak and unregister_netdevice() waits.
v8 moves the lock into j1939_tp_set_rxtimeout() and routes both armers
through one helper:
if (hrtimer_try_to_cancel(&session->rxtimer) == 1)
j1939_session_put(session);
j1939_session_get(session);
hrtimer_start(&session->rxtimer, ms_to_ktime(msec),
HRTIMER_MODE_REL_SOFT);
and drops the WAITING_ABORT re-arm, so only the ACTIVE -> WAITING_ABORT
transition arms the abort timer.
Still open: try_to_cancel() returns -1 while the callback runs and does not
dequeue a timer requeued from it, so an arm that races the expiry can still
take a reference it cannot pair. Your review of v9 1/4 says the same thing.
The next version needs an armed flag taken under the list lock.
The Medium was real too. On a receiver the second timers_cancel()/cancel()
pair re-armed the abort timer, then deactivate_activate_next() moved the
session to DONE without cancelling it, so the expiry skipped the
WAITING_ABORT branch, took the generic else and queued RX_ABORT for a
finished session. v9 has no re-arm and j1939_xtp_rx_rts_session_active()
deactivates for both roles.
Lows, all accepted: the subject was retitled in v8; the Fixes should be
d966635b384b, not 9d71dd0c7009; abort_sent never distinguished anything,
since __j1939_session_cancel() always sets WAITING_ABORT and skips the abort
for broadcasts; and restarting the 500ms deadline on every cancel is a real
behaviour change the v7 message did not describe.
Thanks,
Chaosheng
pw-bot: cr
next prev parent reply other threads:[~2026-11-13 3:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 1:34 [PATCH net v7 0/4] can: j1939: fix the abort timer and bound EDPO Chaosheng Qu
2026-11-08 1:34 ` [PATCH net v7 4/4] can: j1939: reject a CTS that names more packets than the message has Chaosheng Qu
2026-11-12 21:49 ` netdev-bot+sashiko
2026-11-13 3:11 ` Chaosheng Qu
2026-11-08 1:34 ` [PATCH net v7 1/4] can: j1939: arm the abort timer under the session list lock Chaosheng Qu
2026-11-12 21:49 ` netdev-bot+sashiko
2026-11-13 3:11 ` Chaosheng Qu [this message]
2026-11-08 1:34 ` [PATCH net v7 2/4] can: j1939: validate the EDPO packet number Chaosheng Qu
2026-11-12 21:49 ` netdev-bot+sashiko
2026-11-13 3:11 ` Chaosheng Qu
2026-11-08 1:34 ` [PATCH net v7 3/4] can: j1939: drop the message when the reassembled skb is gone Chaosheng Qu
2026-11-12 21:49 ` netdev-bot+sashiko
2026-11-13 3:11 ` Chaosheng Qu
2026-11-13 7:25 ` Oleksij Rempel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179453947397.30993.11677929413398880016@163.com \
--to=quchaosheng000406@163.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev-bot+sashiko@kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=robin@protonic.nl \
--cc=socketcan@hartkopp.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®