From: Cong Wang <xiyou.wangcong@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Cong Wang <cong.wang@bytedance.com>,
shaozhengchao <shaozhengchao@huawei.com>,
Paolo Abeni <pabeni@redhat.com>,
Tom Herbert <tom@herbertland.com>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [Patch net] kcm: fix a race condition in kcm_recvmsg()
Date: Fri, 28 Oct 2022 12:21:11 -0700 [thread overview]
Message-ID: <Y1wrp4pL4BmUL0LE@pop-os.localdomain> (raw)
In-Reply-To: <20221025160222.5902e899@kernel.org>
On Tue, Oct 25, 2022 at 04:02:22PM -0700, Jakub Kicinski wrote:
> On Sat, 22 Oct 2022 19:30:44 -0700 Cong Wang wrote:
> > + spin_lock_bh(&mux->rx_lock);
> > KCM_STATS_INCR(kcm->stats.rx_msgs);
> > skb_unlink(skb, &sk->sk_receive_queue);
> > + spin_unlock_bh(&mux->rx_lock);
>
> Why not switch to __skb_unlink() at the same time?
> Abundance of caution?
What gain do we have? Since we have rx_lock, skb queue lock should never
be contended?
Thanks.
next prev parent reply other threads:[~2022-10-28 19:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-23 2:30 [Patch net] kcm: fix a race condition in kcm_recvmsg() Cong Wang
2022-10-25 23:02 ` Jakub Kicinski
2022-10-25 23:49 ` Eric Dumazet
2022-10-28 19:24 ` Cong Wang
2022-10-28 19:21 ` Cong Wang [this message]
2022-10-28 23:27 ` Jakub Kicinski
2022-11-01 20:52 ` Cong Wang
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=Y1wrp4pL4BmUL0LE@pop-os.localdomain \
--to=xiyou.wangcong@gmail.com \
--cc=cong.wang@bytedance.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shaozhengchao@huawei.com \
--cc=tom@herbertland.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