From: Yonghong Song <yonghong.song@linux.dev>
To: Jiawei Ye <jiawei.ye@foxmail.com>,
martin.lau@linux.dev, daniel@iogearbox.net, edumazet@google.com,
kuba@kernel.org
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bpf: Fix mismatched RCU unlock flavour in bpf_out_neigh_v6
Date: Fri, 8 Nov 2024 11:29:10 -0800 [thread overview]
Message-ID: <ea4d87c5-ce13-43e3-8cec-b068055b0f58@linux.dev> (raw)
In-Reply-To: <tencent_CFD3D1C3D68B45EA9F52D8EC76D2C4134306@qq.com>
On 11/8/24 12:18 AM, Jiawei Ye wrote:
> In the bpf_out_neigh_v6 function, rcu_read_lock() is used to begin an RCU
> read-side critical section. However, when unlocking, one branch
> incorrectly uses a different RCU unlock flavour rcu_read_unlock_bh()
> instead of rcu_read_unlock(). This mismatch in RCU locking flavours can
> lead to unexpected behavior and potential concurrency issues.
>
> This possible bug was identified using a static analysis tool developed
> by myself, specifically designed to detect RCU-related issues.
>
> This patch corrects the mismatched unlock flavour by replacing the
> incorrect rcu_read_unlock_bh() with the appropriate rcu_read_unlock(),
> ensuring that the RCU critical section is properly exited. This change
> prevents potential synchronization issues and aligns with proper RCU
> usage patterns.
>
> Fixes: 09eed1192cec ("neighbour: switch to standard rcu, instead of rcu_bh")
> Signed-off-by: Jiawei Ye <jiawei.ye@foxmail.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
next prev parent reply other threads:[~2024-11-08 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 8:18 [PATCH] bpf: Fix mismatched RCU unlock flavour in bpf_out_neigh_v6 Jiawei Ye
2024-11-08 19:29 ` Yonghong Song [this message]
2024-11-08 20:50 ` patchwork-bot+netdevbpf
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=ea4d87c5-ce13-43e3-8cec-b068055b0f58@linux.dev \
--to=yonghong.song@linux.dev \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=edumazet@google.com \
--cc=jiawei.ye@foxmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
/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).