mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 14:44:10 +08:00
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>
This commit is contained in:
parent
1d7322f28f
commit
bf36267e3a
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user