mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
net: annotate data-races around cleanup_net_task
from_cleanup_net() reads cleanup_net_task locklessly.
Add READ_ONCE()/WRITE_ONCE() annotations to avoid
a potential KCSAN warning, even if the race is harmless.
Fixes: 0734d7c3d9 ("net: expedite synchronize_net() for cleanup_net()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://patch.msgid.link/20250604093928.1323333-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
e6854be4d8
commit
535caaca92
@@ -10499,7 +10499,7 @@ static void dev_index_release(struct net *net, int ifindex)
|
||||
static bool from_cleanup_net(void)
|
||||
{
|
||||
#ifdef CONFIG_NET_NS
|
||||
return current == cleanup_net_task;
|
||||
return current == READ_ONCE(cleanup_net_task);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user