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] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PAXPR04MB851055F069DF8C17C9B367628811A@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Fri, 19 Sep 2025 02:02:23 +0000
From: Wei Fang <wei.fang@....com>
To: Vladimir Oltean <vladimir.oltean@....com>,
	Köry Maincent <kory.maincent@...tlin.com>
CC: Claudiu Manoil <claudiu.manoil@....com>, Clark Wang
	<xiaoning.wang@....com>, "Y.B. Lu" <yangbo.lu@....com>,
	"richardcochran@...il.com" <richardcochran@...il.com>,
	"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "davem@...emloft.net"
	<davem@...emloft.net>, "edumazet@...gle.com" <edumazet@...gle.com>,
	"kuba@...nel.org" <kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
	Frank Li <frank.li@....com>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] net: enetc: use generic interfaces to get
 phc_index for ENETC v1

> On Thu, Sep 18, 2025 at 03:44:54PM +0800, Wei Fang wrote:
> > @@ -954,17 +957,9 @@ static int enetc_get_ts_info(struct net_device
> *ndev,
> >  	if (!enetc_ptp_clock_is_enabled(si))
> >  		goto timestamp_tx_sw;
> >
> > -	if (is_enetc_rev1(si)) {
> > -		phc_idx = symbol_get(enetc_phc_index);
> > -		if (phc_idx) {
> > -			info->phc_index = *phc_idx;
> 
> phc_idx remains unused in enetc_get_ts_info() after this change, and it
> produces a build warning.

Oh, I missed the build warning, sorry.

> 
> > -			symbol_put(enetc_phc_index);
> > -		}
> > -	} else {
> > -		info->phc_index = enetc4_get_phc_index(si);
> > -		if (info->phc_index < 0)
> > -			goto timestamp_tx_sw;
> > -	}
> > +	info->phc_index = enetc_get_phc_index(si);
> > +	if (info->phc_index < 0)
> > +		goto timestamp_tx_sw;
> >
> >  	enetc_get_ts_generic_info(ndev, info);
> >
> 
> It looks like we have a problem and can't call pci_get_slot(), which
> sleeps on down_read(&pci_bus_sem), from ethtool_ops :: get_ts_info(),
> which can't sleep, as of commit 4c61d809cf60 ("net: ethtool: Fix
> suspicious rcu_dereference usage").
> 

Thanks for catching this issue. CONFIG_DEBUG_ATOMIC_SLEEP was not
enabled in my config file, so I did not see this issue on both i.MX95 and
LS1028A. :(

The introduction of rcu_read_lock() in __ethtool_get_ts_info() makes
the device drivers cannot use any functions which might sleep, I do not
have an idea to fix this issue in the upper layer. Currently, I can use
pci_get_domain_bus_and_slot() to instead of pci_get_slot() to fix this
issue in the enetc driver.

> pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ