From: Jacob Keller <jacob.e.keller@intel.com>
To: Kohei Enju <kohei@enjuk.jp>, <intel-wired-lan@lists.osuosl.org>,
<netdev@vger.kernel.org>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
"Aleksandr Loktionov" <aleksandr.loktionov@intel.com>,
Alexander Lobakin <aleksander.lobakin@intel.com>,
<kohei.enju@gmail.com>
Subject: Re: [PATCH v1 iwl-next] ice: fix NULL pointer dereference when changing RX queue length
Date: Mon, 2 Feb 2026 16:31:39 -0800 [thread overview]
Message-ID: <bcefc3ee-4704-483a-8271-01677e47eb8b@intel.com> (raw)
In-Reply-To: <20260202161826.114393-1-kohei@enjuk.jp>
On 2/2/2026 8:17 AM, Kohei Enju wrote:
> When changing RX queue length via 'ethtool -G $DEV rx $NUM', a WARNING
> indicates the driver missed unregistering xdp_rxq_info [1], and then
> NULL pointer dereference panics the kernel. [2]
>
> The following sequence in ice_set_ringparam() triggers this bug.
> 1. Allocate new rx_rings
> 2. rx_rings[i] = *vsi->rx_rings[i];
> 3. ice_down() unregisters vsi->rx_rings[i]->xdp_rxq
> 4. ice_up() registers rx_ring[i]->xdp_rxq
> a. __xdp_rxq_info_reg() sees the copied state REG_STATE_REGISTERED
> and calls xdp_rxq_info_unreg() to fix it [1]
> b. xdp_unreg_mem_model() looks up the stale mem.id in rhashtable,
> which was already removed in step 3, causing NULL dereference [2]
>
> The root cause is that struct copying includes xdp_rxq_info which
> contains registration state that should not be duplicated.
>
> Fix by clearing xdp_rxq_info after copying the ring so it starts with
> REG_STATE_NEW instead of the stale REG_STATE_REGISTERED.
>
> [1]
> Missing unregister, handled but fix driver
> WARNING: net/core/xdp.c:182 at __xdp_rxq_info_reg+0x89/0x150, CPU#4: ethtool/1105
> [...]
> RIP: 0010:__xdp_rxq_info_reg+0x89/0x150
> [...]
> Call Trace:
> <TASK>
> ice_queue_mem_alloc+0x159/0x240
> ice_vsi_cfg_rxq+0xc3/0x160
> ice_vsi_cfg_rxqs+0x4f/0x70
> ice_up+0xd/0x20
> ice_set_ringparam+0x34f/0x4e0
>
> [2]
> BUG: kernel NULL pointer dereference, address: 0000000000000008
> [...]
> RIP: 0010:xdp_unreg_mem_model+0x113/0x340
> [...]
> Call Trace:
> <TASK>
> __xdp_rxq_info_reg+0xfd/0x150
> ice_queue_mem_alloc+0x159/0x240
> ice_vsi_cfg_rxq+0xc3/0x160
> ice_vsi_cfg_rxqs+0x4f/0x70
> ice_up+0xd/0x20
> ice_set_ringparam+0x34f/0x4e0
>
> Fixes: 111a8e2be488 ("ice: implement Rx queue management ops")
> Signed-off-by: Kohei Enju <kohei@enjuk.jp>
> ---
> I see the Fixes: commit exists in only tnguy/next-queue.git, so I'm
> sending this patch to iwl-next, not iwl-net.
>
> Also IIUC dev-queue in tnguy/next-queue.git is rebased continuously, so
> the commit hash will be stale soon, and I don't know how to handle this.
>
Yea. Including the full subject line should be sufficient for Tony to
find this.
> I'd appreciate it if iwl-folks know the way to handle it. Thanks!
Ideally we can squash this in with the implementation patches and
include your Co-developed-by and Signed-off-by tags if you would agree
to that?
next prev parent reply other threads:[~2026-02-03 0:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 16:17 [PATCH v1 iwl-next] ice: fix NULL pointer dereference when changing RX queue length Kohei Enju
2026-02-02 16:28 ` Loktionov, Aleksandr
2026-02-03 0:31 ` Jacob Keller [this message]
2026-02-03 3:23 ` [PATCH v1 iwl-next] ice: fix NULL pointer dereference when Kohei Enju
2026-02-04 11:52 ` [PATCH v1 iwl-next] ice: fix NULL pointer dereference when changing RX queue length Alexander Lobakin
2026-02-04 13:06 ` [PATCH v1 iwl-next] ice: fix NULL pointer dereference when Kohei Enju
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=bcefc3ee-4704-483a-8271-01677e47eb8b@intel.com \
--to=jacob.e.keller@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kohei.enju@gmail.com \
--cc=kohei@enjuk.jp \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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