diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-13 13:51:51 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-29 17:25:09 +0200 |
commit | 1d3eeb199970297305af56686eebf75da5ade7f5 (patch) | |
tree | 2d66e61b25434061625f8c7c51d5070794ee6ae2 /drivers/net | |
parent | 6bf450d92d0c5673ea5a7934083758c579a7fef0 (diff) | |
download | linux-stable-1d3eeb199970297305af56686eebf75da5ade7f5.tar.gz linux-stable-1d3eeb199970297305af56686eebf75da5ade7f5.tar.bz2 linux-stable-1d3eeb199970297305af56686eebf75da5ade7f5.zip |
ip: Fix data-races around sysctl_ip_default_ttl.
commit 8281b7ec5c56b71cb2cc5a1728b41607be66959c upstream.
While reading sysctl_ip_default_ttl, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/flower/action.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/action.c b/drivers/net/ethernet/netronome/nfp/flower/action.c index 2a432de11858..df5a6a0bf1d5 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/action.c +++ b/drivers/net/ethernet/netronome/nfp/flower/action.c @@ -472,7 +472,7 @@ nfp_fl_set_tun(struct nfp_app *app, struct nfp_fl_set_tun *set_tun, set_tun->ttl = ip4_dst_hoplimit(&rt->dst); ip_rt_put(rt); } else { - set_tun->ttl = net->ipv4.sysctl_ip_default_ttl; + set_tun->ttl = READ_ONCE(net->ipv4.sysctl_ip_default_ttl); } } |