]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
igb: Fix NULL pointer dereference in ethtool loopback test
authorTianyu Xu <tianyxu@cisco.com>
Tue, 12 Aug 2025 13:10:56 +0000 (21:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:37:36 +0000 (16:37 +0200)
[ Upstream commit 75871a525a596ff4d16c4aebc0018f8d0923c9b1 ]

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 to it.
Therefore, simply use 0 as the last parameter.

Fixes: 2c6196013f84 ("igb: Add AF_XDP zero-copy Rx support")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Tianyu Xu <tianyxu@cisco.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igb/igb_main.c

index b76a154e635e0007911875e097f35acdcedaba76..d87438bef6fba5fe0b8f370cb9a914a84210784b 100644 (file)
@@ -4451,8 +4451,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);