[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea4d87c5-ce13-43e3-8cec-b068055b0f58@linux.dev>
Date: Fri, 8 Nov 2024 11:29:10 -0800
From: Yonghong Song <yonghong.song@...ux.dev>
To: Jiawei Ye <jiawei.ye@...mail.com>, martin.lau@...ux.dev,
daniel@...earbox.net, edumazet@...gle.com, kuba@...nel.org
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bpf: Fix mismatched RCU unlock flavour in
bpf_out_neigh_v6
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@...mail.com>
Acked-by: Yonghong Song <yonghong.song@...ux.dev>
Powered by blists - more mailing lists