diff options
| author | Marc Kleine-Budde <mkl@pengutronix.de> | 2026-09-28 13:01:30 +0200 |
|---|---|---|
| committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2026-11-03 19:54:29 +0100 |
| commit | d3592ab8a1911ea25b6efa3d5b85def73c69f060 (patch) | |
| tree | 5d46fac7d68e6db9e097e2f4e9eb72081ddf483c /include | |
| parent | 933bf0fcb325e67b19c86c9c4da7f029878d5170 (diff) | |
| parent | b4ebcbbf66ba6c5816dfe229effb4641c46e4b4c (diff) | |
Merge patch series "can: skb: make echo skb freeing safe in any IRQ context"
Cunhao Lu <1579567540@qq.com> says:
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.
Link: https://patch.msgid.link/tencent_CD05F020BAFB2537F5D1F4CBB425588EA80A@qq.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/can/dev.h | 2 | ||||
| -rw-r--r-- | include/linux/can/skb.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 6d0710d6f571..346faddee02e 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h @@ -176,7 +176,7 @@ static inline bool can_dev_dropped_skb(struct net_device *dev, struct sk_buff *s return can_dropped_invalid_skb(dev, skb); invalid_skb: - kfree_skb(skb); + dev_kfree_skb_any(skb); dev->stats.tx_dropped++; return true; } diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h index 5d27843862fc..87ace09c0d8b 100644 --- a/include/linux/can/skb.h +++ b/include/linux/can/skb.h @@ -78,12 +78,12 @@ static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb) nskb = skb_clone(skb, GFP_ATOMIC); if (unlikely(!nskb)) { - kfree_skb(skb); + dev_kfree_skb_any(skb); return NULL; } can_skb_set_owner(nskb, skb->sk); - consume_skb(skb); + dev_consume_skb_any(skb); return nskb; } |
