From: sashiko-bot@kernel.org
To: "Shitalkumar Gandhi" <shital.gandhi45@gmail.com>,
intel-wired-lan@lists.osuosl.org
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH iwl-next 2/2] ice: wait for one RCU grace period when destroying XDP rings
Date: Fri, 20 Nov 2026 15:13:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-225443@kernel.org> (raw)
In-Reply-To: <20261120150527.14649-3-shital.gandhi45@gmail.com>
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Critical] ice: use-after-free in ice_vsi_clear_rings() [1]
--
commit 43d9078a23fe9ac7d73bcbe7267574a26a1906b4
Author: Shitalkumar Gandhi <shital.gandhi45@gmail.com>
ice: wait for one RCU grace period when destroying XDP rings
This commit replaces the per-ring synchronize_rcu() in
ice_destroy_xdp_rings() with a single synchronize_net() call before the
ring teardown loop.
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 0d823e7f4cdcd..254668d4e3963 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -2891,12 +2891,16 @@ int ice_destroy_xdp_rings(struct ice_vsi *vsi, enum ice_xdp_cfg cfg_type)
> }
> mutex_unlock(&pf->avail_q_mutex);
>
> + /* Let in-progress ndo_xdp_xmit and ndo_xsk_wakeup calls finish before
> + * the rings they may be using are freed. The VSI is down at this
> + * point, so one grace period is enough for all rings.
> + */
> + synchronize_net();
> +
> ice_for_each_xdp_txq(vsi, i)
> if (vsi->xdp_rings[i]) {
> - if (vsi->xdp_rings[i]->desc) {
> - synchronize_rcu();
> + if (vsi->xdp_rings[i]->desc)
> ice_free_tx_ring(vsi->xdp_rings[i]);
> - }
> kfree_rcu(vsi->xdp_rings[i]->ring_stats, rcu);
> vsi->xdp_rings[i]->ring_stats = NULL;
> kfree_rcu(vsi->xdp_rings[i], rcu);
[Severity: Critical]
This problem wasn't introduced by this patch, but can calling kfree_rcu()
on vsi->xdp_rings[i]->ring_stats and vsi->xdp_rings[i] before clearing
those pointers cause a use-after-free [1]?
An RCU reader entering between kfree_rcu() and the NULL assignment can
still observe the pointer after the grace period for reclaiming it has
already started, so the object can be freed while the reader is using it
(the same ordering also exists in ice_vsi_clear_rings() for vsi->tx_rings
and vsi->rx_rings).
[1] https://sashiko.dev/#/bug/linux-8bb69a7d-5d05-41df-ae26-5fe9622f437d
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120150527.14649-1-shital.gandhi45@gmail.com?part=2
next parent reply other threads:[~2026-11-20 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20261120150527.14649-1-shital.gandhi45@gmail.com>
[not found] ` <20261120150527.14649-3-shital.gandhi45@gmail.com>
2026-11-20 15:13 ` sashiko-bot [this message]
[not found] ` <20261120150527.14649-2-shital.gandhi45@gmail.com>
2026-11-20 15:17 ` [PATCH iwl-next 1/2] i40e: wait for one RCU grace period in i40e_down(), not one per queue sashiko-bot
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=sashiko-outbox-225443@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shital.gandhi45@gmail.com \
/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