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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SJ0PR11MB5866428A3D9E154AFA71AD7CE5B52@SJ0PR11MB5866.namprd11.prod.outlook.com>
Date: Tue, 8 Apr 2025 04:55:14 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Jesse Brandeburg <jbrandeb@...nel.org>, "intel-wired-lan@...ts.osuosl.org"
	<intel-wired-lan@...ts.osuosl.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<przemyslaw.kitszel@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David
 S. Miller" <davem@...emloft.net>, "Dumazet, Eric" <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "Richard
 Cochran" <richardcochran@...il.com>, "Brandeburg, Jesse"
	<jbrandeburg@...udflare.com>
Subject: RE: [Intel-wired-lan] [PATCH intel-next v1] ice: be consistent around
 PTP de-registration



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Jesse Brandeburg
> Sent: Tuesday, April 8, 2025 1:20 AM
> To: intel-wired-lan@...ts.osuosl.org
> Cc: netdev@...r.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@...el.com>; Andrew Lunn <andrew+netdev@...n.ch>;
> David S. Miller <davem@...emloft.net>; Dumazet, Eric
> <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
> <pabeni@...hat.com>; Richard Cochran <richardcochran@...il.com>;
> Brandeburg, Jesse <jbrandeburg@...udflare.com>
> Subject: [Intel-wired-lan] [PATCH intel-next v1] ice: be consistent around PTP
> de-registration
> 
> From: Jesse Brandeburg <jbrandeburg@...udflare.com>
> 
> The driver was being inconsistent when de-registering its PTP clock. Make sure
> to NULL out the pointer once it is freed in all cases. The driver was mostly
> already doing so, but a couple spots were missed.
> 
> Signed-off-by: Jesse Brandeburg <jbrandeburg@...udflare.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@...el.com>
> ---
> NOTE: we saw some odd behavior on one or two machines where the ports
> completed init, PTP completed init, then port 0 was "hot removed" via sysfs,
> and later panics on ptp->index being 1 while being called by ethtool. This
> caused me to look over this area and see this inconsistency.
> I wasn't able to confirm any for-sure bug.
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 5 ++++-
> drivers/net/ethernet/intel/ice/ice_ptp.c  | 4 ++--
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index 049edeb60104..8c1b496e84ef 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -3968,8 +3968,11 @@ static void ice_deinit_pf(struct ice_pf *pf)
>  		pf->avail_rxqs = NULL;
>  	}
> 
> -	if (pf->ptp.clock)
> +	if (pf->ptp.clock) {
>  		ptp_clock_unregister(pf->ptp.clock);
> +		pf->ptp.clock = NULL;
> +	}
> +	pf->ptp.state = ICE_PTP_UNINIT;
> 
>  	xa_destroy(&pf->dyn_ports);
>  	xa_destroy(&pf->sf_nums);
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c
> b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 1fd1ae03eb90..d7a5c3fb7948 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -3407,9 +3407,9 @@ void ice_ptp_init(struct ice_pf *pf)
> 
>  err_exit:
>  	/* If we registered a PTP clock, release it */
> -	if (pf->ptp.clock) {
> +	if (ptp->clock) {
>  		ptp_clock_unregister(ptp->clock);
> -		pf->ptp.clock = NULL;
> +		ptp->clock = NULL;
>  	}
>  	ptp->state = ICE_PTP_ERROR;
>  	dev_err(ice_pf_to_dev(pf), "PTP failed %d\n", err);
> --
> 2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ