ipv4: igmp: annotate data-races around in_dev->mc_count
authorYuyang Huang <yuyanghuang@google.com>
Fri, 5 Jun 2026 01:43:17 +0000 (10:43 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 9 Jun 2026 11:19:33 +0000 (13:19 +0200)
commit1719841cab55d9da92b2e55b6e0c701e10201467
tree9d6a84926780de7db704145fc1c0937b67c472f0
parent193b76eb109ed3ed77400c6d493b2f495ca64d9e
ipv4: igmp: annotate data-races around in_dev->mc_count

/proc/net/igmp walks the multicast list for IPv4 interfaces locklessly
under RCU and prints state->in_dev->mc_count. Concurrently, device
init/destruction and multicast join/leave paths update the count
under the RTNL lock. Fix this intentional lockless snapshot by
annotating the read with READ_ONCE() and the updates with WRITE_ONCE().

Signed-off-by: Yuyang Huang <yuyanghuang@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260605014318.3890804-2-yuyanghuang@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/igmp.c