[PATCH v3 0/3] can: skb: make CAN skb freeing safe in any IRQ context
From: Cunhao Lu
Date: Fri Jul 31 2026 - 05:51:40 EST
can_put_echo_skb() and the CAN skb allocation helpers may release skbs in
hardware interrupt context or while hardware interrupts are disabled. This
series makes the affected public helper paths safe in either context and
fixes the invalid echo-index skb leak.
---
Changes in v3:
- Cover can_create_echo_skb(), including its successful-clone consume path.
- Add an IRQ-safe release for CAN skb extension allocation failures.
- Link to v2:
https://lore.kernel.org/linux-can/tencent_549A2499DA04F6919D002944523FCC267D07@xxxxxx
Changes in v2:
- Add a preparatory patch replacing the existing kfree_skb() calls in
can_put_echo_skb() with dev_kfree_skb_any().
- Free the skb with dev_kfree_skb_any() on an invalid echo index.
- Collect Vincent's Reviewed-by tag for the binding patch
- Link to v1:
https://lore.kernel.org/linux-can/tencent_944DADCC4B42C8484EC01DA2B15F42132906@xxxxxx
To: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
To: Vincent Mailhol <mailhol@xxxxxxxxxx>
Cc: linux-can@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Cunhao Lu <1579567540@xxxxxx>
---
Cunhao Lu (3):
can: skb: make echo skb freeing safe in any IRQ context
can: skb: make CAN skb allocation failure paths IRQ-safe
can: dev: can_put_echo_skb(): free skb on invalid echo index
drivers/net/can/dev/skb.c | 11 ++++++-----
include/linux/can/skb.h | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
---
base-commit: 8ba098e6b6ff0db8edf28528d1552be261af30d4
change-id: 20260730-master-abf3e4067e47
Best regards,
--
Cunhao Lu <1579567540@xxxxxx>