diff options
author | 2024-02-28 13:54:28 +0000 | |
---|---|---|
committer | 2024-03-01 08:42:31 +0000 | |
commit | e7135f484994494a38071e3653a83d21d305f50c (patch) | |
tree | 734c791bf55fa4646d61929ada3684bc5de0791f /net/ipv6/route.c | |
parent | ipv6: addrconf_disable_ipv6() optimization (diff) | |
download | linux-e7135f484994494a38071e3653a83d21d305f50c.tar.gz linux-e7135f484994494a38071e3653a83d21d305f50c.tar.bz2 linux-e7135f484994494a38071e3653a83d21d305f50c.zip |
ipv6: annotate data-races around cnf.mtu6
idev->cnf.mtu6 might be read locklessly, add appropriate READ_ONCE()
and WRITE_ONCE() annotations.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 707d65bc9c0e..66c685b0b619 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1596,7 +1596,7 @@ static unsigned int fib6_mtu(const struct fib6_result *res) rcu_read_lock(); idev = __in6_dev_get(dev); - mtu = idev->cnf.mtu6; + mtu = READ_ONCE(idev->cnf.mtu6); rcu_read_unlock(); } @@ -3249,8 +3249,8 @@ u32 ip6_mtu_from_fib6(const struct fib6_result *res, mtu = IPV6_MIN_MTU; idev = __in6_dev_get(dev); - if (idev && idev->cnf.mtu6 > mtu) - mtu = idev->cnf.mtu6; + if (idev) + mtu = max_t(u32, mtu, READ_ONCE(idev->cnf.mtu6)); } mtu = min_t(unsigned int, mtu, IP6_MAX_MTU); |