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: <ZC1QgGW5HZqcYIug@smile.fi.intel.com>
Date:   Wed, 5 Apr 2023 13:42:08 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Yehezkel Bernat <YehezkelShB@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] net: thunderbolt: Fix sparse warnings

On Wed, Apr 05, 2023 at 12:52:24PM +0300, Mika Westerberg wrote:
> On Wed, Apr 05, 2023 at 11:45:43AM +0300, Andy Shevchenko wrote:
> > On Tue, Apr 04, 2023 at 08:36:35AM +0300, Mika Westerberg wrote:

...

> > > drivers/net/thunderbolt/main.c:993:23:    expected restricted __wsum [usertype] wsum
> > > drivers/net/thunderbolt/main.c:993:23:    got restricted __be32 [usertype]
> > 
> > You can drop the whole part with file name and line numbers to make the above
> > neater.
> 
> I guess it is good to leave the filename, there like this, no?
> 
> main.c:993:23:    expected restricted __wsum [usertype] wsum
> main.c:993:23:    got restricted __be32 [usertype]

Fine by me.

...

> > > +		net->rx_hdr.frame_size = hdr->frame_size;
> > > +		net->rx_hdr.frame_count = hdr->frame_count;
> > > +		net->rx_hdr.frame_index = hdr->frame_index;
> > > +		net->rx_hdr.frame_id = hdr->frame_id;
> > > +		last = le16_to_cpu(net->rx_hdr.frame_index) ==
> > > +		       le32_to_cpu(net->rx_hdr.frame_count) - 1;

...

> > > -	__wsum wsum = htonl(skb->len - skb_transport_offset(skb));
> > > +	/* Remove payload length from checksum */
> > > +	u32 paylen = skb->len - skb_transport_offset(skb);
> > > +	__wsum wsum = (__force __wsum)htonl(paylen);

> > I would split wsum fix from the above as they are of different nature.
> 
> How they are different? The complain is pretty much the same for all
> these AFAICT:
> 
> expected restricted xxx [usertype] yyy
> got restricted zzz [usertype]

While the main part is about header data type and endianess conversion between
protocol and CPU (with cpu_*() and *_cpu() macros) this one is completely network
related stuff as it's using hton*() and ntoh*() conversion macros. Yes, underneeth
it may be the same, but semantically these two parts are not of the same thing.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ