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: <0a779070-d91a-49df-a606-5fc9428e312c@bp.renesas.com>
Date: Thu, 3 Oct 2024 10:23:35 +0100
From: Paul Barker <paul.barker.ct@...renesas.com>
To: Sergey Shtylyov <s.shtylyov@....ru>, Paul Barker <paul@...rker.dev>,
 "David S . Miller" <davem@...emloft.net>, Eric Dumazet
 <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>
Cc: Geert Uytterhoeven <geert+renesas@...der.be>,
 Niklas Söderlund <niklas.soderlund+renesas@...natech.se>,
 Biju Das <biju.das.jz@...renesas.com>,
 Claudiu Beznea <claudiu.beznea.uj@...renesas.com>, netdev@...r.kernel.org,
 linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [net-next PATCH 05/11] net: ravb: Simplify types in RX csum
 validation

On 30/09/2024 20:11, Sergey Shtylyov wrote:
> On 9/30/24 19:08, Paul Barker wrote:
> 
>> From: Paul Barker <paul.barker.ct@...renesas.com>
>>
>> The HW checksum value is used as a 16-bit flag, it is zero when the
> 
>    I think I prefer s/HW/hardware/ but there's no hard feelings... :-)
> 
>> checksum has been validated and non-zero otherwise. Therefore we don't
>> need to treat this as an actual __wsum type or call csum_unfold(), we
>> can just use a u16 pointer.
>>
>> Signed-off-by: Paul Barker <paul.barker.ct@...renesas.com>
> [...]
>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>> index 1dd2152734b0..9350ca10ab22 100644
>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> [...]
>> @@ -762,23 +761,22 @@ static void ravb_rx_csum_gbeth(struct sk_buff *skb)
>>  	 * The last 2 bytes are the protocol checksum status which will be zero
>>  	 * if the checksum has been validated.
>>  	 */
>> -	if (unlikely(skb->len < sizeof(__sum16) * 2))
>> +	csum_len = sizeof(*hw_csum) * 2;
> 
>    Could've been done by an initializer instead?

So, if I move this to the initializers at the start of the function,
csum_len must be declared after hw_csum which breaks reverse Christmas
tree ordering:

    struct skb_shared_info *shinfo = skb_shinfo(skb);
    u16 *hw_csum;
    size_t csum_len = sizeof(*hw_csum) * 2;

Thanks,

-- 
Paul Barker
Download attachment "OpenPGP_0x27F4B3459F002257.asc" of type "application/pgp-keys" (3521 bytes)

Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ