diff options
author | Eric Dumazet <edumazet@google.com> | 2024-04-04 11:42:31 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-05 22:32:37 -0700 |
commit | f410cbea9f3d2675b4c8e52af1d1985b11b387d1 (patch) | |
tree | e407bf74e04719f2aadbec9acd9ac32501fe67b0 /net/ipv4/syncookies.c | |
parent | 571faefe09f5aae894c4373179569fbc2c2a3114 (diff) | |
download | linux-f410cbea9f3d2675b4c8e52af1d1985b11b387d1.tar.gz linux-f410cbea9f3d2675b4c8e52af1d1985b11b387d1.tar.bz2 linux-f410cbea9f3d2675b4c8e52af1d1985b11b387d1.zip |
tcp: annotate data-races around tp->window_clamp
tp->window_clamp can be read locklessly, add READ_ONCE()
and WRITE_ONCE() annotations.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://lore.kernel.org/r/20240404114231.2195171-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/syncookies.c')
-rw-r--r-- | net/ipv4/syncookies.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c index 500f665f98cb..b61d36810fe3 100644 --- a/net/ipv4/syncookies.c +++ b/net/ipv4/syncookies.c @@ -462,7 +462,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) } /* Try to redo what tcp_v4_send_synack did. */ - req->rsk_window_clamp = tp->window_clamp ? :dst_metric(&rt->dst, RTAX_WINDOW); + req->rsk_window_clamp = READ_ONCE(tp->window_clamp) ? : + dst_metric(&rt->dst, RTAX_WINDOW); /* limit the window selection if the user enforce a smaller rx buffer */ full_space = tcp_full_space(sk); if (sk->sk_userlocks & SOCK_RCVBUF_LOCK && |