lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <IA3PR11MB8986D980FA81E9920CC4CBD8E581A@IA3PR11MB8986.namprd11.prod.outlook.com>
Date: Mon, 12 Jan 2026 09:58:48 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Li Li <boolli@...gle.com>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<przemyslaw.kitszel@...el.com>, "David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "David
 Decotigny" <decot@...gle.com>, "Singhai, Anjali" <anjali.singhai@...el.com>,
	"Samudrala, Sridhar" <sridhar.samudrala@...el.com>, Brian Vazquez
	<brianvv@...gle.com>, "Tantilov, Emil S" <emil.s.tantilov@...el.com>
Subject: RE: [Intel-wired-lan] [PATCH 3/5] idpf: skip getting RX flow rules if
 vport is NULL during HW reset



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf
> Of Li Li via Intel-wired-lan
> Sent: Wednesday, January 7, 2026 2:05 AM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel,
> Przemyslaw <przemyslaw.kitszel@...el.com>; David S. Miller
> <davem@...emloft.net>; Jakub Kicinski <kuba@...nel.org>; Eric Dumazet
> <edumazet@...gle.com>; intel-wired-lan@...ts.osuosl.org
> Cc: netdev@...r.kernel.org; linux-kernel@...r.kernel.org; David
> Decotigny <decot@...gle.com>; Singhai, Anjali
> <anjali.singhai@...el.com>; Samudrala, Sridhar
> <sridhar.samudrala@...el.com>; Brian Vazquez <brianvv@...gle.com>; Li
> Li <boolli@...gle.com>; Tantilov, Emil S <emil.s.tantilov@...el.com>
> Subject: [Intel-wired-lan] [PATCH 3/5] idpf: skip getting RX flow
> rules if vport is NULL during HW reset
> 
> When an idpf HW reset is triggered, it clears the vport but does not
> clear the netdev held by vport:
> 
>     // In idpf_vport_dealloc() called by idpf_init_hard_reset(),
>     // idpf_init_hard_reset() sets IDPF_HR_RESET_IN_PROG, so
>     // idpf_decfg_netdev() doesn't get called.
>     if (!test_bit(IDPF_HR_RESET_IN_PROG, adapter->flags))
>         idpf_decfg_netdev(vport);
>     // idpf_decfg_netdev() would clear netdev but it isn't called:
>     unregister_netdev(vport->netdev);
>     free_netdev(vport->netdev);
>     vport->netdev = NULL;
>     // Later in idpf_init_hard_reset(), the vport is cleared:
>     kfree(adapter->vports);
>     adapter->vports = NULL;
> 
> During an idpf HW reset, when userspace gets RX flow classification
> rules of the netdev, the vport associated with the netdev is NULL, and
> so a kernel panic would happen:
> 
> [ 1466.308592] BUG: kernel NULL pointer dereference, address:
> 0000000000000032 ...
> [ 1466.356222] RIP: 0010:idpf_get_rxnfc+0x3b/0x70
> 
> This can be reproduced reliably by injecting a TX timeout to cause an
> idpf HW reset, and injecting a virtchnl error to cause the HW reset to
> fail and retry, while running "ethtool -n" in userspace.
> 
> With this patch applied, we see the following error but no kernel
> panics anymore:
> 
> [  312.476576] idpf 0000:05:00.0 eth1: failed to get rules due to no
> vport in netdev Cannot get RX rings: Bad address
> rxclass: Cannot get RX class rule count: Bad address RX classification
> rule retrieval failed
> 
> Signed-off-by: Li Li <boolli@...gle.com>
> ---
>  drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> index 6a4b630b786c2..c71af85408a29 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
> @@ -45,6 +44,11 @@ static int idpf_get_rxnfc(struct net_device
> *netdev, struct ethtool_rxnfc *cmd,
> 
>  	idpf_vport_ctrl_lock(netdev);
>  	vport = idpf_netdev_to_vport(netdev);
> +	if (!vport) {
> +		netdev_err(netdev, "failed to get rules due to no vport
> in netdev\n");
> +		err = -EFAULT;
> +		goto unlock;
> +	}
>  	vport_config = np->adapter->vport_config[np->vport_idx];
>  	user_config = &vport_config->user_config;
> 
> @@ -85,6 +90,7 @@ static int idpf_get_rxnfc(struct net_device *netdev,
> struct ethtool_rxnfc *cmd,
>  		break;
>  	}
> 
> +unlock:
>  	idpf_vport_ctrl_unlock(netdev);
> 
>  	return err;
> --
> 2.52.0.351.gbe84eed79e-goog

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ