diff options
author | Eric Dumazet <edumazet@google.com> | 2022-11-15 10:18:51 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-11-16 14:32:53 +0100 |
commit | bf36267e3ad3df80a3a18eb0422723069a434934 (patch) | |
tree | 698aa0d1372d12317be857fd00305b399c91115c /net/ipv4 | |
parent | ax25: af_ax25: Remove unnecessary (void*) conversions (diff) | |
download | linux-bf36267e3ad3df80a3a18eb0422723069a434934.tar.xz linux-bf36267e3ad3df80a3a18eb0422723069a434934.zip |
tcp: annotate data-race around queue->synflood_warned
Annotate the lockless read of queue->synflood_warned.
Following xchg() has the needed data-race resolution.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_input.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 94024fdc2da1..0ae291e53eab 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -6841,7 +6841,7 @@ static bool tcp_syn_flood_action(const struct sock *sk, const char *proto) #endif __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPREQQFULLDROP); - if (!queue->synflood_warned && syncookies != 2 && + if (!READ_ONCE(queue->synflood_warned) && syncookies != 2 && xchg(&queue->synflood_warned, 1) == 0) { if (IS_ENABLED(CONFIG_IPV6) && sk->sk_family == AF_INET6) { net_info_ratelimited("%s: Possible SYN flooding on port [%pI6c]:%u. %s.\n", |