aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-06-04 09:39:28 +0000
committerJakub Kicinski <kuba@kernel.org>2025-06-05 08:02:26 -0700
commit535caaca921c653b1f9838fbd5c4e9494cafc3d9 (patch)
tree492e601eeeec5d1a5b7ead08f628b709c49e6009 /net/core/dev.c
parentselftests: drv-net: tso: make bkg() wait for socat to quit (diff)
downloadwireguard-linux-535caaca921c653b1f9838fbd5c4e9494cafc3d9.tar.xz
wireguard-linux-535caaca921c653b1f9838fbd5c4e9494cafc3d9.zip
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: 0734d7c3d93c ("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>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index a388f459a366..be97c440ecd5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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