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: <20250306142343.37ff9a48@kmaincent-XPS-13-7390>
Date: Thu, 6 Mar 2025 14:23:43 +0100
From: Kory Maincent <kory.maincent@...tlin.com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com, Andrew Lunn
 <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>, Eric Dumazet
 <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon Horman
 <horms@...nel.org>
Subject: Re: [PATCH net] net: ethtool: tsinfo: Fix dump command

On Thu, 6 Mar 2025 10:38:58 +0000
Vadim Fedorenko <vadim.fedorenko@...ux.dev> wrote:

> On 05/03/2025 14:03, Kory Maincent wrote:
> > Fix missing initialization of ts_info->phc_index in the dump command,
> > which could cause a netdev interface to incorrectly display a PTP provider
> > at index 0 instead of "none".
> > Fix it by initializing the phc_index to -1.
> > 
> > In the same time, restore missing initialization of ts_info.cmd for the
> > IOCTL case, as it was before the transition from ethnl_default_dumpit to
> > custom ethnl_tsinfo_dumpit.
> > 
> > Fixes: b9e3f7dc9ed95 ("net: ethtool: tsinfo: Enhance tsinfo to support
> > several hwtstamp by net topology") Signed-off-by: Kory Maincent
> > <kory.maincent@...tlin.com> ---
> >   net/ethtool/tsinfo.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/net/ethtool/tsinfo.c b/net/ethtool/tsinfo.c
> > index 691be6c445b38..9edc5dc30de88 100644
> > --- a/net/ethtool/tsinfo.c
> > +++ b/net/ethtool/tsinfo.c
> > @@ -291,6 +291,8 @@ static void *ethnl_tsinfo_prepare_dump(struct sk_buff
> > *skb, memset(reply_data, 0, sizeof(*reply_data));
> >   	reply_data->base.dev = dev;
> >   	memset(&reply_data->ts_info, 0, sizeof(reply_data->ts_info));
> > +	reply_data->ts_info.cmd = ETHTOOL_GET_TS_INFO;
> > +	reply_data->ts_info.phc_index = -1;  
> 
> This change makes sense, but I'm curious why do we need
> memset(&reply_data->ts_info, 0, sizeof(reply_data->ts_info))
> at all? ts_info is embedded into reply_data which fully zeroed 2 lines
> before.

Indeed you are right, this is totally useless.
I will remove it.

Regards,

-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ