diff options
author | Eric Dumazet <edumazet@google.com> | 2023-12-08 13:12:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-12-11 13:59:17 +0300 |
commit | d2f011a0bf28c090ad75c9b1d306f2e1dda1c9bc (patch) | |
tree | 672849531d60dae088df5508f6183ea01231b6ae /net/ipv6/ping.c | |
parent | 9a64d4c93eee6b2efb7a02ec98d9480946424509 (diff) | |
download | linux-d2f011a0bf28c090ad75c9b1d306f2e1dda1c9bc.tar.xz |
ipv6: annotate data-races around np->mcast_oif
np->mcast_oif is read locklessly in some contexts.
Make all accesses to this field lockless, adding appropriate
annotations.
This also makes setsockopt( IPV6_MULTICAST_IF ) lockless.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ping.c')
-rw-r--r-- | net/ipv6/ping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index d2098dd4ceae..465e8d004067 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c @@ -107,7 +107,7 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) oif = np->sticky_pktinfo.ipi6_ifindex; if (!oif && ipv6_addr_is_multicast(daddr)) - oif = np->mcast_oif; + oif = READ_ONCE(np->mcast_oif); else if (!oif) oif = np->ucast_oif; @@ -157,7 +157,7 @@ static int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) rt = (struct rt6_info *) dst; if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) - fl6.flowi6_oif = np->mcast_oif; + fl6.flowi6_oif = READ_ONCE(np->mcast_oif); else if (!fl6.flowi6_oif) fl6.flowi6_oif = np->ucast_oif; |