diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-13 22:51:52 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-15 12:49:55 +0200 |
commit | 0968d2a441bf6afb551fd99e60fa65ed67068963 (patch) | |
tree | 94b301f59fbd5390e80493ce1845272c0e644c0e /net/ipv4/icmp.c | |
parent | ip: Fix data-races around sysctl_ip_default_ttl. (diff) | |
download | linux-0968d2a441bf6afb551fd99e60fa65ed67068963.tar.xz linux-0968d2a441bf6afb551fd99e60fa65ed67068963.zip |
ip: Fix data-races around sysctl_ip_no_pmtu_disc.
While reading sysctl_ip_no_pmtu_disc, 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>
Diffstat (limited to 'net/ipv4/icmp.c')
-rw-r--r-- | net/ipv4/icmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 57c4f0d87a7a..d5d745c3e345 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -881,7 +881,7 @@ static enum skb_drop_reason icmp_unreach(struct sk_buff *skb) * values please see * Documentation/networking/ip-sysctl.rst */ - switch (net->ipv4.sysctl_ip_no_pmtu_disc) { + switch (READ_ONCE(net->ipv4.sysctl_ip_no_pmtu_disc)) { default: net_dbg_ratelimited("%pI4: fragmentation needed and DF set\n", &iph->daddr); |