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: <13805dc8-4f96-9621-3b8b-4ec5ea6aeffe@csgroup.eu>
Date:   Thu, 17 Feb 2022 18:11:58 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "David S. Miller" <davem@...emloft.net>,
        Pablo Neira Ayuso <pablo@...filter.org>,
        Jozsef Kadlecsik <kadlec@...filter.org>,
        Florian Westphal <fw@...len.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "netfilter-devel@...r.kernel.org" <netfilter-devel@...r.kernel.org>,
        "coreteam@...filter.org" <coreteam@...filter.org>
Subject: Re: [PATCH net-next v1] net: Use csum_replace_... and csum_sub()
 helpers instead of opencoding



Le 17/02/2022 à 18:24, Jakub Kicinski a écrit :
> On Thu, 17 Feb 2022 16:43:55 +0100 Christophe Leroy wrote:
>>   static inline void nft_csum_replace(__sum16 *sum, __wsum fsum, __wsum tsum)
>>   {
>> -	*sum = csum_fold(csum_add(csum_sub(~csum_unfold(*sum), fsum), tsum));
>> +	csum_replace4(sum, fsum, tsum);
> 
> Sparse says:
> 
> net/netfilter/nft_payload.c:560:28: warning: incorrect type in argument 2 (different base types)
> net/netfilter/nft_payload.c:560:28:    expected restricted __be32 [usertype] from
> net/netfilter/nft_payload.c:560:28:    got restricted __wsum [usertype] fsum

Yes I saw it in patchwork, thanks.

Looks like csum_replace4() expects __be32 inputs, I'll look at it but 
I'm not inclined at adding force cast, so will probably leave 
nft_csum_replace() as is.

Thanks
Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ