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: <a8a523bb-a50a-419c-8ba8-78a3e7aa0daa@linux.dev>
Date: Wed, 15 Oct 2025 20:58:03 +0100
From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To: Jacob Keller <jacob.e.keller@...el.com>,
 Shyam Sundar S K <Shyam-sundar.S-k@....com>,
 Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Egor Pomozov <epomozov@...vell.com>, Potnuri Bharat Teja
 <bharat@...lsio.com>, Dimitris Michailidis <dmichail@...gible.com>,
 MD Danish Anwar <danishanwar@...com>, Roger Quadros <rogerq@...nel.org>
Cc: Richard Cochran <richardcochran@...il.com>,
 Russell King <linux@...linux.org.uk>,
 Vladimir Oltean <vladimir.oltean@....com>, Simon Horman <horms@...nel.org>,
 netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 3/7] amd-xgbe: convert to ndo_hwtstamp
 callbacks

On 15.10.2025 20:47, Jacob Keller wrote:
> 
> 
> On 10/14/2025 3:42 PM, Vadim Fedorenko wrote:
>> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c b/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c
>> index bc52e5ec6420..0127988e10be 100644
>> --- a/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c
>> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-hwtstamp.c
>> @@ -157,26 +157,24 @@ void xgbe_tx_tstamp(struct work_struct *work)
>>   	spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
>>   }
>>   
>> -int xgbe_get_hwtstamp_settings(struct xgbe_prv_data *pdata, struct ifreq *ifreq)
>> +int xgbe_get_hwtstamp_settings(struct net_device *netdev,
>> +			       struct kernel_hwtstamp_config *config)
>>   {
>> -	if (copy_to_user(ifreq->ifr_data, &pdata->tstamp_config,
>> -			 sizeof(pdata->tstamp_config)))
>> -		return -EFAULT;
>> +	struct xgbe_prv_data *pdata = netdev_priv(netdev);
>> +
>> +	*config = pdata->tstamp_config;
>>   
>>   	return 0;
>>   }
>>   
>> -int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata, struct ifreq *ifreq)
>> +int xgbe_set_hwtstamp_settings(struct net_device *netdev,
>> +			       struct kernel_hwtstamp_config *config,
>> +			       struct netlink_ext_ack *extack)
>>   {
>> -	struct hwtstamp_config config;
>> -	unsigned int mac_tscr;
>> -
>> -	if (copy_from_user(&config, ifreq->ifr_data, sizeof(config)))
>> -		return -EFAULT;
>> -
>> -	mac_tscr = 0;
>> +	struct xgbe_prv_data *pdata = netdev_priv(netdev);
>> +	unsigned int mac_tscr = 0;
>>   
> 
> I noticed in this driver you didn't bother to add NL_SET_ERR_MSG calls.
> Any particular reason?

The only error here is the -ERANGE which is self-explanatory, so I decided to
keep the amount of changed lines as low as possible.

We might think of adding netlink error message for ERANGE error in
dev_set_hwtstamp() in case the driver skips setting specific message.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ