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 /include | |
| parent | 6bf450d92d0c5673ea5a7934083758c579a7fef0 (diff) | |
| download | linux-1d3eeb199970297305af56686eebf75da5ade7f5.tar.gz linux-1d3eeb199970297305af56686eebf75da5ade7f5.tar.bz2 linux-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 'include')
| -rw-r--r-- | include/net/route.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/route.h b/include/net/route.h index 2551f3f03b37..30610101ea14 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -360,7 +360,7 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst) struct net *net = dev_net(dst->dev); if (hoplimit == 0) - hoplimit = net->ipv4.sysctl_ip_default_ttl; + hoplimit = READ_ONCE(net->ipv4.sysctl_ip_default_ttl); return hoplimit; } |
