netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Vadim Fedorenko <vadfed@meta.com>,
	Andy Lutomirski <luto@amacapital.net>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Willem de Bruijn <willemb@google.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v2] net-timestamp: make sk_tskey more predictable in error path
Date: Mon, 12 Feb 2024 23:44:53 +0000	[thread overview]
Message-ID: <567a7062-9b4a-42dd-a8da-e60f948a62f0@linux.dev> (raw)
In-Reply-To: <65ca450938c4a_1a1761294e3@willemb.c.googlers.com.notmuch>

On 12/02/2024 11:19, Willem de Bruijn wrote:
> Vadim Fedorenko wrote:
>> When SOF_TIMESTAMPING_OPT_ID is used to ambiguate timestamped datagrams,
>> the sk_tskey can become unpredictable in case of any error happened
>> during sendmsg(). Move increment later in the code and make decrement of
>> sk_tskey in error path. This solution is still racy in case of multiple
>> threads doing snedmsg() over the very same socket in parallel, but still
>> makes error path much more predictable.
>>
>> Fixes: 09c2d251b707 ("net-timestamp: add key to disambiguate concurrent datagrams")
>> Reported-by: Andy Lutomirski <luto@amacapital.net>
>> Signed-off-by: Vadim Fedorenko <vadfed@meta.com>
> 
> What is the difference with v1?

Ah, sorry, was in a rush.

v1 -> v2:
  - use local boolean variable instead of checking the same conditions 
twice.

  reply	other threads:[~2024-02-12 23:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12  0:13 [PATCH net v2] net-timestamp: make sk_tskey more predictable in error path Vadim Fedorenko
2024-02-12 16:19 ` Willem de Bruijn
2024-02-12 23:44   ` Vadim Fedorenko [this message]
2024-02-13  2:17     ` Willem de Bruijn
2024-02-13 10:59       ` Vadim Fedorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=567a7062-9b4a-42dd-a8da-e60f948a62f0@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=luto@amacapital.net \
    --cc=netdev@vger.kernel.org \
    --cc=vadfed@meta.com \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).