From: Dmitry Antipov <dmantipov@yandex.ru>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: John Fastabend <john.fastabend@gmail.com>,
Jakub Sitnicki <jakub@cloudflare.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH RFC net] net: sockmap: avoid race between sock_map_destroy() and sk_psock_put()
Date: Mon, 9 Sep 2024 10:04:21 +0300 [thread overview]
Message-ID: <5d23bd86-150f-40a3-ab43-a468b3133bc4@yandex.ru> (raw)
In-Reply-To: <Zt3up5aOcu5icAUr@pop-os.localdomain>
On 9/8/24 9:36 PM, Cong Wang wrote:
> Are you sure it is due to sockmap code?
No, and that's why my patch has RFC tag in subject :-).
> I see rds_tcp_accept_one() in the stack trace. This is why I highly
> suspect that it is due to RDS code instead of sockmap code.
>
> I have the following patch ready for testing, in case you are
> interested.
Does it work for you? Running current upstream with this patch applied,
I'm still seeing the same warning at net/core/sock_map.c:1663.
Again, I'm suspecting the race just because 'sk_psock_drop()' issues
'sk_psock_restore_proto()' with 'sk->sk_callback_lock' write locked,
but 'sock_map_destroy()' just uses 'READ_ONCE()' to obtain a callback
which may be changed underneath.
BTW looking here and there again, I suppose that my patch is not correct
too because it moves and/or shrinks the race window but doesn't eliminate
it completely.
Dmitry
next prev parent reply other threads:[~2024-09-09 7:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 6:42 [PATCH RFC net] net: sockmap: avoid race between sock_map_destroy() and sk_psock_put() Dmitry Antipov
2024-09-08 18:36 ` Cong Wang
2024-09-09 7:04 ` Dmitry Antipov [this message]
2024-09-11 4:32 ` Cong Wang
2024-09-11 9:51 ` Dmitry Antipov
2024-09-11 16:45 ` Cong Wang
2024-09-12 15:59 ` Dmitry Antipov
2024-09-14 0:34 ` Cong Wang
2024-09-18 15:42 ` Dmitry Antipov
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=5d23bd86-150f-40a3-ab43-a468b3133bc4@yandex.ru \
--to=dmantipov@yandex.ru \
--cc=jakub@cloudflare.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xiyou.wangcong@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