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: <8755fdba-7151-4452-87f7-2407b47c0801@openvpn.net>
Date: Wed, 26 Mar 2025 14:54:15 +0100
From: Antonio Quartulli <antonio@...nvpn.net>
To: Qingfang Deng <dqfext@...il.com>
Cc: Simon Horman <horms@...nel.org>, linux-kernel@...r.kernel.org,
 linux-kselftest@...r.kernel.org, netdev@...r.kernel.org,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Donald Hunter <donald.hunter@...il.com>,
 Shuah Khan <shuah@...nel.org>, sd@...asysnail.net, ryazanov.s.a@...il.com,
 Andrew Lunn <andrew+netdev@...n.ch>, Xiao Liang <shaw.leon@...il.com>
Subject: Re: [PATCH net-next v24 09/23] ovpn: implement packet processing

On 26/03/2025 13:43, Qingfang Deng wrote:
> On Wed, Mar 26, 2025 at 6:22 PM Antonio Quartulli <antonio@...nvpn.net> wrote:
>>>> This is not what we want.
>>>
>>> Got it. You could replace it with
>>> atomic_fetch_add_unless(&pid->seq_num, 1, 0) and check if it wraps
>>> around to zero.
>>
>> What about the first time when seq_num is 0? It will already stop, no?
> 
> The initial value of seq_num is 1.

Ah, you're right. Because atomic_fetch_add_unless() returns the original 
value.

Then I think your whole suggestion makes sense.
I will switch to atomic_t (32bit) and check for the wrap-around.

Cheers,

-- 
Antonio Quartulli
OpenVPN Inc.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ