From: netdev-bot+sashiko@kernel.org
To: mkl@pengutronix.de
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
linux-can@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH net-next 10/12] can: skb: make echo skb freeing safe in any IRQ context
Date: Mon, 19 Oct 2026 18:07:23 +0000 [thread overview]
Message-ID: <179243324322.3135.6343395816383334540@kernel.org> (raw)
In-Reply-To: <20261018164417.1540449-11-mkl@pengutronix.de>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] This patch changes can_create_echo_skb() in
include/linux/can/skb.h to release the original skb with…
--
can: skb: make echo skb freeing safe in any IRQ context
The commit converts the drop paths in can_put_echo_skb(),
can_dropped_invalid_skb() and can_dev_dropped_skb() from kfree_skb() to
dev_kfree_skb_any(). It also makes can_create_echo_skb() release the
original skb with dev_consume_skb_any() instead of consume_skb(). This
makes the release safe when the caller has hardware interrupts disabled.
Link: https://patch.msgid.link/tencent_E84809CF236D0137885E7E4E4D58340B3208@qq.com
> diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h
> index 5d27843862fca..87ace09c0d8bd 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);
[Severity: Low]
This isn't a bug, but should the comment in virtio_can_start_xmit() in
drivers/net/can/virtio_can.c be updated as well? It still names
consume_skb():
drivers/net/can/virtio_can.c:virtio_can_start_xmit() {
...
if (unlikely(err)) {
/*
* can_put_echo_skb() already consumed skb via consume_skb(),
* so returning NETDEV_TX_BUSY would cause the stack to requeue
* a freed pointer. Drop the frame and return OK instead.
*/
...
}
The ownership point in the comment still holds, because the original skb
is still released. After this change, though, the release goes through
dev_consume_skb_any(). That either defers the free through
dev_kfree_skb_irq_reason() or calls kfree_skb_reason(skb, SKB_CONSUMED).
> return nskb;
> }
>
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261018164417.1540449-2-mkl%40pengutronix.de
next prev parent reply other threads:[~2026-10-19 18:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 16:41 [PATCH net-next 0/12] pull-request: can-next 2026-10-18 Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 01/12] can: dev: can_dropped_invalid_skb: drop CAN XL frames on non-CAN XL devices Marc Kleine-Budde
2026-10-18 16:54 ` netdev-bot+sinfo
2026-10-18 16:41 ` [PATCH net-next 02/12] can: raw: remove redundant NULL check before netdev_hold() Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 03/12] can: replace ARPHRD_CAN type checks with can_get_ml_priv() Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 04/12] can: isotp: fix filter removal race between release and netns change Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 05/12] can: proc: reset pkg_stats atomics individually Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 06/12] can: bcm: fix filter removal race between release and netns change Marc Kleine-Budde
2026-10-18 18:37 ` Oliver Hartkopp
2026-10-19 8:30 ` Oliver Hartkopp
2026-10-19 9:18 ` Marc Kleine-Budde
2026-10-19 18:07 ` netdev-bot+sashiko
2026-10-19 19:20 ` Oliver Hartkopp
2026-10-18 16:41 ` [PATCH net-next 07/12] can: proc: remove pointers from CAN specific proc output Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 08/12] can: raw: take rtnl_lock() before leaving the notifier list Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 09/12] can: isotp: check the frame type, not just the length Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 10/12] can: skb: make echo skb freeing safe in any IRQ context Marc Kleine-Budde
2026-10-19 18:07 ` netdev-bot+sashiko [this message]
2026-10-18 16:41 ` [PATCH net-next 11/12] can: skb: make CAN skb allocation failure paths IRQ-safe Marc Kleine-Budde
2026-10-18 16:41 ` [PATCH net-next 12/12] can: dev: can_put_echo_skb(): free skb on invalid echo index Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179243324322.3135.6343395816383334540@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox