summaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-12-08 11:12:43 +0100
committerDavid S. Miller <davem@davemloft.net>2023-12-11 11:59:17 +0100
commitd2f011a0bf28c090ad75c9b1d306f2e1dda1c9bc (patch)
tree672849531d60dae088df5508f6183ea01231b6ae /net/dccp/ipv6.c
parentRevert "net: rtnetlink: remove local list in __linkwatch_run_queue()" (diff)
downloadlinux-d2f011a0bf28c090ad75c9b1d306f2e1dda1c9bc.tar.xz
linux-d2f011a0bf28c090ad75c9b1d306f2e1dda1c9bc.zip
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/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 4550b680665a..06d7324276ec 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -669,7 +669,7 @@ discard:
ipv6_pktoptions:
if (!((1 << sk->sk_state) & (DCCPF_CLOSED | DCCPF_LISTEN))) {
if (np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo)
- np->mcast_oif = inet6_iif(opt_skb);
+ WRITE_ONCE(np->mcast_oif, inet6_iif(opt_skb));
if (np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim)
WRITE_ONCE(np->mcast_hops, ipv6_hdr(opt_skb)->hop_limit);
if (np->rxopt.bits.rxflow || np->rxopt.bits.rxtclass)