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: <89f263be-3403-8404-69ed-313539d59669@redhat.com>
Date: Thu, 15 Feb 2024 17:24:13 -0500
From: Jon Maloy <jmaloy@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Cc: kuba@...nel.org, passt-dev@...st.top, sbrivio@...hat.com,
 lvivier@...hat.com, dgibson@...hat.com, netdev@...r.kernel.org,
 davem@...emloft.net
Subject: Re: [PATCH v3] tcp: add support for SO_PEEK_OFF



On 2024-02-15 12:46, Eric Dumazet wrote:
> On Thu, Feb 15, 2024 at 6:41 PM Paolo Abeni <pabeni@...hat.com> wrote:
>> Note: please send text-only email to netdev.
>>
>> On Thu, 2024-02-15 at 10:11 -0500, Jon Maloy wrote:
>>> I wonder if the following could be acceptable:
>>>
>>>   if (flags & MSG_PEEK)
>>>          sk_peek_offset_fwd(sk, used);
>>>   else if (peek_offset > 0)
>>>         sk_peek_offset_bwd(sk, used);
>>>
>>>   peek_offset is already present in the data cache, and if it has the value
>>>   zero it means either that that sk->sk_peek_off is unused (-1) or actually is zero.
>>>   Either way, no rewind is needed in that case.
>> I agree the above should avoid touching cold cachelines in the
>> fastpath, and looks functionally correct to me.
>>
>> The last word is up to Eric :)
>>
> An actual patch seems needed.
>
> In the current form, local variable peek_offset is 0 when !MSG_PEEK.
>
> So the "else if (peek_offset > 0)" would always be false.
>
Yes, of course. This wouldn't work unless we read sk->sk_peek_off at the 
beginning of the function.
I will look at the other suggestions.

///jon



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ