Netdev List
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: netdev-bot+sinfo@kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	linux-can@vger.kernel.org, kernel@pengutronix.de,
	stable@vger.kernel.org, Vincent Mailhol <mailhol@kernel.org>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Zhu Ling <zhuling0805@qq.com>
Subject: Re: [PATCH net 01/11] can: bcm: copy the CAN frames outside of lock_sock()
Date: Wed, 18 Nov 2026 08:47:11 +0100	[thread overview]
Message-ID: <c72cd2f8-755d-4223-8c84-d8ff831b63fd@hartkopp.net> (raw)
In-Reply-To: <179495352427.3291.18107293383947918297@kernel.org>



On 17.11.26 23:12, netdev-bot+sinfo@kernel.org wrote:
> Hi!
> 
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
> 
>   - How the issue was discovered, e.g. hit in production, hit during
>     development, syzbot report, manual code inspection, LLM or static
>     analysis tool scan.
> 
>   - Whether the issue was actually triggered, or is only theoretical
>     (e.g. found by LLM and not proven at runtime). If it was triggered
>     please include the symptoms, like the stack trace or kernel messages.
> 
The issue was not reported or observed in production. It was found in
a review and later proven by a test that provokes an RTNL stall:

The Sashiko AI review (LLM) of a former CAN_BCM patch found a wait
chain, where a task that is blocked in a copy to user space holds
lock_sock() while the netdev notifier waits for it under RTNL. At that
time the chain was a stalled reader of the CAN_BCM procfs entry, which
is fixed by "can: bcm: do not remove the procfs entry in bcm_notify()"
in this pull request. Following this, the CAN_RAW and CAN_ISOTP socket
options have been moved outside of lock_sock() with commit 43c973a0887d
("can: raw, isotp: copy socket options outside of lock_sock()").

A subsequent LLM assisted review of the locking in net/can identified
bcm_sendmsg() as the remaining instance of this wait chain: the CAN
frames are copied from user space with memcpy_from_msg() under
lock_sock(), while bcm_notify() takes lock_sock() of every CAN_BCM
socket in the namespace on NETDEV_UNREGISTER under RTNL.

The issue has now been triggered at runtime, analogue to the test for
the procfs reader.

With this patch, "can: bcm: do not remove the procfs entry in
bcm_notify()" and "can: bcm: use a private mutex instead of
lock_sock()" in this pull request, stalled user space accesses on
CAN_BCM sockets can not block RTNL anymore.

Best regards,
Oliver

  reply	other threads:[~2026-11-18  7:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 22:03 [PATCH net 0/11] pull-request: can 2026-11-17 Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 01/11] can: bcm: copy the CAN frames outside of lock_sock() Marc Kleine-Budde
2026-11-17 22:12   ` netdev-bot+sinfo
2026-11-18  7:47     ` Oliver Hartkopp [this message]
2026-11-17 22:03 ` [PATCH net 02/11] can: bcm: do not remove the procfs entry in bcm_notify() Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 03/11] can: raw: use a private mutex instead of lock_sock() Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 04/11] can: isotp: " Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 05/11] can: bcm: " Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 06/11] can: isotp: always start the rx timeout in ISOTP_WAIT_DATA state Marc Kleine-Budde
2026-11-18 22:19   ` netdev-bot+sashiko
2026-11-17 22:03 ` [PATCH net 07/11] can: isotp: reject socket options while a transfer is active Marc Kleine-Budde
2026-11-18 22:19   ` netdev-bot+sashiko
2026-11-17 22:03 ` [PATCH net 08/11] can: netlink: fix static FD-NON-ISO mode validation Marc Kleine-Budde
2026-11-18 22:19   ` netdev-bot+sashiko
2026-11-17 22:03 ` [PATCH net 09/11] can: netlink: fix IFLA_CAN_BITRATE_MAX attribute sizing Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 10/11] can: netlink: fix CAN XL PWM " Marc Kleine-Budde
2026-11-17 22:03 ` [PATCH net 11/11] can: gs_usb: gs_can_start_xmit(): don't leak uninitialized memory over USB Marc Kleine-Budde

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=c72cd2f8-755d-4223-8c84-d8ff831b63fd@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=davem@davemloft.net \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev-bot+sinfo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=stable@vger.kernel.org \
    --cc=zhuling0805@qq.com \
    /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