[PATCH v3 0/3] can: skb: make CAN skb freeing safe in any IRQ context
Cunhao Lu <[email protected]> Fri, 31 Jul 2026 17:44:59 +0800
| Newsgroups | org.kernel.vger.linux-can,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
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/[email protected] 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/[email protected] To: Marc Kleine-Budde <[email protected]> To: Vincent Mailhol <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Cunhao Lu <[email protected]> --- 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 <[email protected]>