Skip to content

can: bcm: collected fixes

Oliver Hartkopp b4-sent linux-can sashiko-reviews 15 versions – In review

Get series with b4
b4 am [email protected] change-id 20260612-bcm_fixes-84fb4aa93ac2

Versions newest first

  1. v15 Latest11 patches 1 replyIn review
  2. v1411 patches 0 repliesSuperseded
  3. v1311 patches 13 repliesSuperseded
Earlier versions · 12
VersionPostedPatchesRepliesStatus
v1211 patches0 repliesSuperseded
v1111 patches0 repliesSuperseded
v1010 patches3 repliesSuperseded
v910 patches0 repliesSuperseded
v810 patches2 repliesSuperseded
v710 patches0 repliesSuperseded
v69 patches0 repliesSuperseded
v58 patches0 repliesSuperseded
v47 patches2 repliesSuperseded
v37 patches7 repliesSuperseded
v26 patches0 repliesSuperseded
v15 patches1 replySuperseded

Changes in v15 from the cover letter

- patch 3: add consistent locking for timers as requested by sashiko bot patch 3: add TX_RESET_MULTI_IDX handling fix inside the lock
- Link to v14: https://patch.msgid.link/[email protected]

Patches in v15 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11can: bcm: defer rx_op deallocation to workqueue to fix thrtimer UAFnet/can/bcm.c+34 -30 replies
2/11can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failurenet/can/bcm.c+51 -140 replies
3/11can: bcm: add locking when updating filter and timer valuesnet/can/bcm.c+133 -430 replies
4/11can: bcm: fix CAN frame rx/tx statisticsnet/can/bcm.c+46 -230 replies
5/11can: bcm: add missing rcu list annotations and operationsnet/can/bcm.c+16 -91 reply
6/11can: bcm: extend bcm_tx_lock usage for data and timer updatesnet/can/bcm.c+75 -290 replies
7/11can: bcm: validate frame length in bcm_rx_setup() for RTR repliesnet/can/bcm.c+41 -180 replies
8/11can: bcm: add missing device refcount for CAN filter removalnet/can/bcm.c+27 -200 replies
9/11can: bcm: fix stale rx/tx ops after device removalnet/can/bcm.c+44 -100 replies
10/11can: bcm: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler()net/can/bcm.c+8 -50 replies
11/11can: bcm: track a single source interface for ANYDEV timeout/throttle opsnet/can/bcm.c+44 -50 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by.

PatchFeng XueOliver Hartkopp
1/11T-b T-b
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v15 thread

Cover letter [PATCH v15 00/11] can: bcm: collected fixes

Hi Marc,

as there were different patches flying arround to fix CAN_BCM issues and AI assisted stuff pop's up again and again, I've created this collection to be applied.

Fixed issues reported by sashiko-bot for patch 3:
- [High] Lockless reads and writes of timer values and flags in TX path cause a data race and potential torn reads.
- [High] Direct, lockless modification of op->frames array in bcm_tx_setup() leads to data races and unrecoverable state corruption.

Best regards,
Oliver

---
Changes in v15:
- patch 3: add consistent locking for timers as requested by sashiko bot patch 3: add TX_RESET_MULTI_IDX handling fix inside the lock
- Link to v14: https://patch.msgid.link/[email protected]

Changes in v14:
- patch 6: add another lock in bcm_tx_timeout_handler() to snapshot data
- Link to v13: https://patch.msgid.link/[email protected]

Changes in v13:
- patch 9: cancel timers on re-registration failure and comment why.
- Link to v12: https://patch.msgid.link/[email protected]

Changes in v12:
- patch 11: fixed sashiko-bot issues
https://lore.kernel.org/linux-can/[email protected]/
- Link to v11: https://patch.msgid.link/[email protected]

Changes in v11:
- patch 11: new: track a single source interface for ANYDEV timeout/throttle ops reported by sashiko-bot
https://lore.kernel.org/linux-can/[email protected]/
- patch 2: added Fixes: tag (mkl)
- Link to v10: https://patch.msgid.link/[email protected]

Changes in v10:
- patch 4: fixed new issue reported by sashiko-bot
https://lore.kernel.org/linux-can/[email protected]/
- Link to v9: https://patch.msgid.link/[email protected]

Changes in v9:
- patch 4: fixed two issues reported by sashiko-bot and mkl
https://lore.kernel.org/linux-can/[email protected]/
https://lore.kernel.org/linux-can/[email protected]/
- Link to v8: https://patch.msgid.link/[email protected]

Changes in v8:
- patch 9: fixed two issues reported by sashiko-bot:
https://lore.kernel.org/linux-can/[email protected]/
- Link to v7: https://patch.msgid.link/[email protected]

Changes in v7:
- patch 9: new: fix stale rx/tx ops after device removal reported by
sashiko-bot: https://lore.kernel.org/linux-can/[email protected]/
- patch 10: formerly patch 9 as new patch 8 & 9 belong together
- Link to v6: https://patch.msgid.link/[email protected]

Changes in v6:
- patch 1: added Tested-by: tags
- patch 3: changed commit message and comment regarding a wrong claim
about synchronous delivery from dev_queue_xmit() as remarked by
https://netdev-ai.bots.linux.dev/ai-review.html?id=6105ebab-87ef-43db-a085-7c190b9f119f
- patch 4: rebased patch 3 comment
- patch 9: new: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler()
reported by sashiko-bot: https://lore.kernel.org/linux-can/[email protected]/
- Link to v5: https://patch.msgid.link/[email protected]

Changes in v5:
- patch 6: changed comment for bcm_op::bcm_tx_lock (mkl)
- patch 8: new: add missing device refcount for CAN filter removal
- Link to v4: https://patch.msgid.link/[email protected]

Changes in v4:
- incorporated more sashiko-bot concerns from v3
- patch 3: omit hrtimer_forward with zero interval
- patch 4: put bcm_update_stats() under bcm_rx_update_lock
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- incorporated more sashiko-bot concerns from v2
- patch 3: make snapshot of currframe
- patch 6: add error patch for memcpy_from_msg()
- patch 7: new RTR-reply validation in bcm_rx_setup() from bcm_tx_setup()
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- incorporated all sashiko-bot concerns from v1
- Link to v1: https://patch.msgid.link/[email protected]

---
Lee Jones (1):
can: bcm: defer rx_op deallocation to workqueue to fix thrtimer UAF

Oliver Hartkopp (10):
can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failure
can: bcm: add locking when updating filter and timer values
can: bcm: fix CAN frame rx/tx statistics
can: bcm: add missing rcu list annotations and operations
can: bcm: extend bcm_tx_lock usage for data and timer updates
can: bcm: validate frame length in bcm_rx_setup() for RTR replies
can: bcm: add missing device refcount for CAN filter removal
can: bcm: fix stale rx/tx ops after device removal
can: bcm: fix data race on rx_stamp/rx_ifindex in bcm_rx_handler()
can: bcm: track a single source interface for ANYDEV timeout/throttle ops

 net/can/bcm.c | 646 ++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 493 insertions(+), 153 deletions(-)

---
base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
change-id: 20260612-bcm_fixes-84fb4aa93ac2

Best regards,

Signature · 1 line
Oliver Hartkopp <[email protected]>