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: <d2739db2-74bd-4c1f-8f8a-ffaa70f227dd@kernel.org>
Date: Wed, 27 Aug 2025 09:07:05 -0600
From: David Ahern <dsahern@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski
 <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
 eric.dumazet@...il.com
Subject: Re: [PATCH net-next 3/3] inet: ping: make ping_port_rover per netns

On 8/27/25 9:00 AM, Eric Dumazet wrote:
> On Wed, Aug 27, 2025 at 7:57 AM David Ahern <dsahern@...nel.org> wrote:
>>
>> On 8/27/25 6:05 AM, Eric Dumazet wrote:
>>> @@ -84,12 +82,12 @@ int ping_get_port(struct sock *sk, unsigned short ident)
>>>       isk = inet_sk(sk);
>>>       spin_lock(&ping_table.lock);
>>>       if (ident == 0) {
>>> +             u16 result = net->ipv4.ping_port_rover + 1;
>>>               u32 i;
>>> -             u16 result = ping_port_rover + 1;
>>>
>>>               for (i = 0; i < (1L << 16); i++, result++) {
>>>                       if (!result)
>>> -                             result++; /* avoid zero */
>>> +                             continue; /* avoid zero */
>>>                       hlist = ping_hashslot(&ping_table, net, result);
>>>                       sk_for_each(sk2, hlist) {
>>>                               if (!net_eq(sock_net(sk2), net))
>>> @@ -101,7 +99,7 @@ int ping_get_port(struct sock *sk, unsigned short ident)
>>>                       }
>>>
>>>                       /* found */
>>> -                     ping_port_rover = ident = result;
>>> +                     net->ipv4.ping_port_rover = ident = result;
>>
>> READ_ONCE above and WRITE_ONCE here?
> 
> Note we hold ping_table.lock for both the read and write,
> so there is no need for READ_ONCE() or WRITE_ONCE() here.
> 
> Thank you !

missed that.

Reviewed-by: David Ahern <dsahern@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ