[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6a7281bf-bc4a-4f75-bb88-7011908ae471@app.fastmail.com>
Date: Wed, 20 Dec 2023 15:59:01 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Willem de Bruijn" <willemdebruijn.kernel@...il.com>,
Jörn-Thorben Hinz <jthinz@...lbox.tu-berlin.de>,
"Thomas Lange" <thomas@...elatus.se>, Netdev <netdev@...r.kernel.org>,
"Deepa Dinamani" <deepa.kernel@...il.com>,
"John Fastabend" <john.fastabend@...il.com>
Subject: Re: net/core/sock.c lacks some SO_TIMESTAMPING_NEW support
On Wed, Dec 20, 2023, at 15:06, Willem de Bruijn wrote:
> Willem de Bruijn wrote:
>> Jörn-Thorben Hinz wrote:
>>
>> __sock_cmsg_send can only modify a subset of the bits in the
>> timestamping feature bitmap, so a call to setsockopt is still needed
>>
>> But there is no ordering requirement, so the __sock_cmsg_send call can
>> come before the setsockopt call. It would be odd, but the API allows it.
>
> But no timestamp is returned unless setsockopt is called. So we can
> continue to rely on that for selecting SOCK_TSTAMP_NEW.
Ok, makes sense. In that case the one-line patch should be sufficient.
> Only question is whether the kernel needs to enfornce the two
> operations to be consistent in their choice between NEW and OLD. I
> don't think so. If they are not, this would be a weird, likely
> deliberate, edge case. It only affects the data returned to the
> process, not kernel integrity.
There is the one corner case where a file descriptor is shared
between tasks that disagree on the layout of the timestamp,
or is accessed from different parts of an application that
were built with inconsistent time32/time64 settings. Both of
these are already impossible to fix in a generic way.
Arnd
Powered by blists - more mailing lists