mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
tcp: rate limit synflood warnings further
Convert pr_info to net_info_ratelimited to limit the total number of
synflood warnings.
Commit 946cedccbd
("tcp: Change possible SYN flooding messages")
rate limits synflood warnings to one per listener.
Workloads that open many listener sockets can still see a high rate of
log messages. Syzkaller is one frequent example.
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2d946e5bcd
commit
0297c1c2ea
@ -6367,8 +6367,8 @@ static bool tcp_syn_flood_action(const struct sock *sk,
|
|||||||
if (!queue->synflood_warned &&
|
if (!queue->synflood_warned &&
|
||||||
net->ipv4.sysctl_tcp_syncookies != 2 &&
|
net->ipv4.sysctl_tcp_syncookies != 2 &&
|
||||||
xchg(&queue->synflood_warned, 1) == 0)
|
xchg(&queue->synflood_warned, 1) == 0)
|
||||||
pr_info("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n",
|
net_info_ratelimited("%s: Possible SYN flooding on port %d. %s. Check SNMP counters.\n",
|
||||||
proto, ntohs(tcp_hdr(skb)->dest), msg);
|
proto, ntohs(tcp_hdr(skb)->dest), msg);
|
||||||
|
|
||||||
return want_cookie;
|
return want_cookie;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user