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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4085013-daaf-4141-af56-cd438bf8b4c9@linux.alibaba.com>
Date: Sat, 7 Dec 2024 10:34:05 +0800
From: Philo Lu <lulie@...ux.alibaba.com>
To: Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
 David Ahern <dsahern@...nel.org>, Jakub Kicinski <kuba@...nel.org>,
 Simon Horman <horms@...nel.org>, Fred Chen <fred.cc@...baba-inc.com>,
 Cambda Zhu <cambda@...ux.alibaba.com>, Willem de Bruijn
 <willemb@...gle.com>, Stefano Brivio <sbrivio@...hat.com>
Subject: Re: [PATCH net] udp: fix l4 hash after reconnect



On 2024/12/7 00:23, Paolo Abeni wrote:
> On 12/6/24 17:01, Eric Dumazet wrote:
>> On Fri, Dec 6, 2024 at 4:57 PM Eric Dumazet <edumazet@...gle.com> wrote:
>>> On Fri, Dec 6, 2024 at 4:50 PM Paolo Abeni <pabeni@...hat.com> wrote:
>>>>
>>>> After the blamed commit below, udp_rehash() is supposed to be called
>>>> with both local and remote addresses set.
>>>>
>>>> Currently that is already the case for IPv6 sockets, but for IPv4 the
>>>> destination address is updated after rehashing.
>>>>
>>>> Address the issue moving the destination address and port initialization
>>>> before rehashing.
>>>>
>>>> Fixes: 1b29a730ef8b ("ipv6/udp: Add 4-tuple hash for connected socket")
>>>> Signed-off-by: Paolo Abeni <pabeni@...hat.com>

Thank you for this fix :)

>>>
>>> Nice catch, thanks !
>>>
>>> Reviewed-by: Eric Dumazet <edumazet@...gle.com>
>>
>> BTW, it seems that udp_lib_rehash() does the udp_rehash4()
>> only if the hash2 has changed.
> 
> Oh, you are right, that requires a separate fix.
> 
> @Philo: could you please have a look at that? basically you need to
> check separately for hash2 and hash4 changes.

This is a good question. IIUC, the only affected case is when trying to 
re-connect another remote address with the same local address (i.e., 
hash2 unchanged). And this will be handled by udp_lib_hash4(). So in 
udp_lib_rehash() I put rehash4() inside hash2 checking, which means a 
passive rehash4 following rehash2.

So I think it's more about the convention for rehash. We can choose the 
better one.

Thanks.
-- 
Philo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ