* [PATCH] igb: Fix NULL pointer dereference in ethtool loopback test
@ 2025-08-11 11:41 Tianyu Xu
2025-08-11 15:45 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-08-11 23:48 ` Joe Damato
0 siblings, 2 replies; 3+ messages in thread
From: Tianyu Xu @ 2025-08-11 11:41 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: przemyslaw.kitszel, andrew+netdev, kuba, sdf, intel-wired-lan,
netdev, linux-kernel, tianyxu
The igb driver currently causes a NULL pointer dereference
when executing the ethtool loopback test. This occurs because
there is no associated q_vector for the test ring when it is
set up, as interrupts are typically not added to the test rings.
Since commit 5ef44b3cb43b removed the napi_id assignment in
__xdp_rxq_info_reg(), there is no longer a need to pass a napi_id.
Therefore, simply use 0 as the final parameter.
Signed-off-by: Tianyu Xu <tianyxu@cisco.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a9a7a94ae..453deb6d1 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4453,8 +4453,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
- rx_ring->queue_index,
- rx_ring->q_vector->napi.napi_id);
+ rx_ring->queue_index, 0);
if (res < 0) {
dev_err(dev, "Failed to register xdp_rxq index %u\n",
rx_ring->queue_index);
--
2.39.5 (Apple Git-154)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [Intel-wired-lan] [PATCH] igb: Fix NULL pointer dereference in ethtool loopback test
2025-08-11 11:41 [PATCH] igb: Fix NULL pointer dereference in ethtool loopback test Tianyu Xu
@ 2025-08-11 15:45 ` Loktionov, Aleksandr
2025-08-11 23:48 ` Joe Damato
1 sibling, 0 replies; 3+ messages in thread
From: Loktionov, Aleksandr @ 2025-08-11 15:45 UTC (permalink / raw)
To: Tianyu Xu, Nguyen, Anthony L
Cc: Kitszel, Przemyslaw, andrew+netdev@lunn.ch, kuba@kernel.org,
sdf@fomichev.me, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
tianyxu@cisco.com
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Tianyu Xu
> Sent: Monday, August 11, 2025 1:42 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
> Cc: Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>;
> andrew+netdev@lunn.ch; kuba@kernel.org; sdf@fomichev.me; intel-wired-
> lan@lists.osuosl.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; tianyxu@cisco.com
> Subject: [Intel-wired-lan] [PATCH] igb: Fix NULL pointer dereference
> in ethtool loopback test
>
> The igb driver currently causes a NULL pointer dereference
> when executing the ethtool loopback test. This occurs because
> there is no associated q_vector for the test ring when it is
> set up, as interrupts are typically not added to the test rings.
>
> Since commit 5ef44b3cb43b removed the napi_id assignment in
> __xdp_rxq_info_reg(), there is no longer a need to pass a napi_id.
> Therefore, simply use 0 as the final parameter.
>
Good day, Tianyu Xu,
Thanks for the patch. I've reviewed the commit message and have a few minor suggestions to align it with kernel style guidelines:
Can you consider wrapping body lines at 75 characters for better readability?
If applicable, please include Fixes: tag in the commit message. This helps maintainers and automated tools track regressions and understand the context of the fix. Other than that, the change itself looks good and clearly improves the accuracy of statistics reporting.
Best regards,
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Tianyu Xu <tianyxu@cisco.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> b/drivers/net/ethernet/intel/igb/igb_main.c
> index a9a7a94ae..453deb6d1 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -4453,8 +4453,7 @@ int igb_setup_rx_resources(struct igb_ring
> *rx_ring)
> if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
> xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
> res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
> - rx_ring->queue_index,
> - rx_ring->q_vector->napi.napi_id);
> + rx_ring->queue_index, 0);
> if (res < 0) {
> dev_err(dev, "Failed to register xdp_rxq index %u\n",
> rx_ring->queue_index);
> --
> 2.39.5 (Apple Git-154)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] igb: Fix NULL pointer dereference in ethtool loopback test
2025-08-11 11:41 [PATCH] igb: Fix NULL pointer dereference in ethtool loopback test Tianyu Xu
2025-08-11 15:45 ` [Intel-wired-lan] " Loktionov, Aleksandr
@ 2025-08-11 23:48 ` Joe Damato
1 sibling, 0 replies; 3+ messages in thread
From: Joe Damato @ 2025-08-11 23:48 UTC (permalink / raw)
To: Tianyu Xu
Cc: anthony.l.nguyen, przemyslaw.kitszel, andrew+netdev, kuba, sdf,
intel-wired-lan, netdev, linux-kernel, tianyxu
On Mon, Aug 11, 2025 at 07:41:53PM +0800, Tianyu Xu wrote:
> The igb driver currently causes a NULL pointer dereference
> when executing the ethtool loopback test. This occurs because
> there is no associated q_vector for the test ring when it is
> set up, as interrupts are typically not added to the test rings.
>
> Since commit 5ef44b3cb43b removed the napi_id assignment in
> __xdp_rxq_info_reg(), there is no longer a need to pass a napi_id.
> Therefore, simply use 0 as the final parameter.
>
> Signed-off-by: Tianyu Xu <tianyxu@cisco.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index a9a7a94ae..453deb6d1 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -4453,8 +4453,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
> if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
> xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
> res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
> - rx_ring->queue_index,
> - rx_ring->q_vector->napi.napi_id);
> + rx_ring->queue_index, 0);
> if (res < 0) {
> dev_err(dev, "Failed to register xdp_rxq index %u\n",
> rx_ring->queue_index);
This LGTM but will probably need to be re-sent with a Fixes tag.
See: https://www.kernel.org/doc/html/v6.16/process/maintainer-netdev.html#tl-dr
If you repost, feel free to add:
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-11 23:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 11:41 [PATCH] igb: Fix NULL pointer dereference in ethtool loopback test Tianyu Xu
2025-08-11 15:45 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-08-11 23:48 ` Joe Damato
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).