Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH 0/3] can: bcm: avoid RTNL stalls and enable memcg accounting
@ 2026-11-07 13:06 Oliver Hartkopp
  2026-11-07 13:06 ` [PATCH 1/3] can: bcm: copy the CAN frames outside of lock_sock() Oliver Hartkopp
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Oliver Hartkopp @ 2026-11-07 13:06 UTC (permalink / raw)
  To: linux-can
  Cc: Marc Kleine-Budde, Oleksij Rempel, Oliver Hartkopp, Sashiko,
	Zihan Xi

This series addresses issues that allow unprivileged users to affect
the whole system through CAN sockets.

Patch 1 copies the CAN frames in bcm_sendmsg() outside of lock_sock(),
so that a stalled copy from user space can not block bcm_notify(),
which takes lock_sock() under RTNL.

Patch 2 keeps the procfs entry of a CAN_BCM socket until bcm_release(),
as remove_proc_entry() in bcm_notify() waits for stalled procfs readers
while holding RTNL.

Patch 3 enables memcg accounting for the allocations that unprivileged
users can trigger in the CAN subsystem. As there is no specific commit
to point to, it has no Fixes: tag and is not marked for stable, like
most of the memcg accounting patches in the networking subsystem. If
you prefer this patch for net-next, please let me know.

CAN_J1939 has similar issues with lock_sock() under RTNL, which will
be addressed separately once the currently discussed j1939 patches
have been merged.

---
Oliver Hartkopp (3):
      can: bcm: copy the CAN frames outside of lock_sock()
      can: bcm: do not remove the procfs entry in bcm_notify()
      can: enable memcg accounting for user triggered allocations

 net/can/af_can.c       | 12 ++++----
 net/can/bcm.c          | 80 ++++++++++++++++++++++++++++++++++++++++----------
 net/can/isotp.c        |  2 +-
 net/can/j1939/main.c   |  2 +-
 net/can/j1939/socket.c | 11 +++++--
 net/can/raw.c          | 13 +++++---
 6 files changed, 90 insertions(+), 30 deletions(-)
---
base-commit: 30c71476d842b094651bd7712f6c8ee8716147d0
change-id: 20261107-can-bcmlock-memcg-2d8ae7361838

Best regards,
--  
Oliver Hartkopp <socketcan@hartkopp.net>


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-11-09  8:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-07 13:06 [PATCH 0/3] can: bcm: avoid RTNL stalls and enable memcg accounting Oliver Hartkopp
2026-11-07 13:06 ` [PATCH 1/3] can: bcm: copy the CAN frames outside of lock_sock() Oliver Hartkopp
2026-11-07 13:15   ` sashiko-bot
2026-11-07 13:29     ` Oliver Hartkopp
2026-11-09  2:18   ` netdev-bot+sashiko
2026-11-09  7:56     ` Oliver Hartkopp
2026-11-07 13:06 ` [PATCH 2/3] can: bcm: do not remove the procfs entry in bcm_notify() Oliver Hartkopp
2026-11-09  2:18   ` netdev-bot+sashiko
2026-11-09  8:00     ` Oliver Hartkopp
2026-11-07 13:06 ` [PATCH 3/3] can: enable memcg accounting for user triggered allocations Oliver Hartkopp
2026-11-07 13:14   ` sashiko-bot
2026-11-07 13:35     ` Oliver Hartkopp
2026-11-08  8:23       ` Oleksij Rempel
2026-11-08  8:21     ` Oleksij Rempel
2026-11-08  8:25   ` Oleksij Rempel
2026-11-09  2:18   ` netdev-bot+sashiko
2026-11-09  8:09     ` Oliver Hartkopp

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