summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_sockglue.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-10-25 18:48:23 +0200
committerJakub Kicinski <kuba@kernel.org>2021-10-26 03:02:13 +0200
commit14834c4f4eb3c8c0af40f6203dbf09d232044d9d (patch)
tree714e8ea9aa75d7e5cc1d7d418401ed3474716dba /net/ipv4/ip_sockglue.c
parentipv6: guard IPV6_MINHOPCOUNT with a static key (diff)
downloadlinux-14834c4f4eb3c8c0af40f6203dbf09d232044d9d.tar.xz
linux-14834c4f4eb3c8c0af40f6203dbf09d232044d9d.zip
ipv4: annotate data races arount inet->min_ttl
No report yet from KCSAN, yet worth documenting the races. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/ip_sockglue.c')
-rw-r--r--net/ipv4/ip_sockglue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index b297bb28556e..d5487c858067 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -1352,7 +1352,10 @@ static int do_ip_setsockopt(struct sock *sk, int level, int optname,
goto e_inval;
if (val < 0 || val > 255)
goto e_inval;
- inet->min_ttl = val;
+ /* tcp_v4_err() and tcp_v4_rcv() might read min_ttl
+ * while we are changint it.
+ */
+ WRITE_ONCE(inet->min_ttl, val);
break;
default: