net: annotate data-races around cleanup_net_task
authorEric Dumazet <edumazet@google.com>
Wed, 4 Jun 2025 09:39:28 +0000 (09:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 5 Jun 2025 15:02:26 +0000 (08:02 -0700)
commit535caaca921c653b1f9838fbd5c4e9494cafc3d9
tree492e601eeeec5d1a5b7ead08f628b709c49e6009
parente6854be4d80ea266a7be64a65a0322bcdfa72807
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>
net/core/dev.c
net/core/net_namespace.c