diff options
author | 2024-02-28 13:54:29 +0000 | |
---|---|---|
committer | 2024-03-01 08:42:31 +0000 | |
commit | e0bb2675fea2783c45bb95d74f00c55156720863 (patch) | |
tree | 0f7a1c6c8a215727d5dfd5ccc5c86fd9ca717b31 /net/ipv6/output_core.c | |
parent | ipv6: annotate data-races around cnf.mtu6 (diff) | |
download | wireguard-linux-e0bb2675fea2783c45bb95d74f00c55156720863.tar.xz wireguard-linux-e0bb2675fea2783c45bb95d74f00c55156720863.zip |
ipv6: annotate data-races around cnf.hop_limit
idev->cnf.hop_limit and net->ipv6.devconf_all->hop_limit
might be read locklessly, add appropriate READ_ONCE()
and WRITE_ONCE() annotations.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Florian Westphal <fw@strlen.de> # for netfilter parts
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/output_core.c')
-rw-r--r-- | net/ipv6/output_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/output_core.c b/net/ipv6/output_core.c index b5205311f372..806d4b5dd1e6 100644 --- a/net/ipv6/output_core.c +++ b/net/ipv6/output_core.c @@ -111,9 +111,9 @@ int ip6_dst_hoplimit(struct dst_entry *dst) rcu_read_lock(); idev = __in6_dev_get(dev); if (idev) - hoplimit = idev->cnf.hop_limit; + hoplimit = READ_ONCE(idev->cnf.hop_limit); else - hoplimit = dev_net(dev)->ipv6.devconf_all->hop_limit; + hoplimit = READ_ONCE(dev_net(dev)->ipv6.devconf_all->hop_limit); rcu_read_unlock(); } return hoplimit; |