Skip to contentSkip to conversation

tcp: rate limit synflood warnings further

PATCH Applied Willem de Bruijn 3 participants 4 messages Sep 10, 2018 – Sep 12, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: rate limit synflood warnings further

From: Willem de Bruijn <[email protected]>

Convert pr_info to net_info_ratelimited to limit the total number of synflood warnings.

Commit 946cedccbd73 ("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.

---
 net/ipv4/tcp_input.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_input.c +2 -2
index 62508a2f9b21..d9034073138c 100644
@@ -6380,8 +6380,8 @@ static bool tcp_syn_flood_action(const struct sock *sk,
 	if (!queue->synflood_warned &&
 	    net->ipv4.sysctl_tcp_syncookies != 2 &&
 	    xchg(&queue->synflood_warned, 1) == 0)
-		pr_info("%s: Possible SYN flooding on port %d. %s.  Check SNMP counters.\n",
-			proto, ntohs(tcp_hdr(skb)->dest), msg);
+		net_info_ratelimited("%s: Possible SYN flooding on port %d. %s.  Check SNMP counters.\n",
+				     proto, ntohs(tcp_hdr(skb)->dest), msg);
 
 	return want_cookie;
 }
Signature · 1 line
2.19.0.rc2.392.g5ba43deb5a-goog
#1 lore raw
Quoted 5 lines · Willem de Bruijn

From: Willem de Bruijn <[email protected]>

Convert pr_info to net_info_ratelimited to limit the total number of synflood warnings.

Quoted 7 lines

Commit 946cedccbd73 ("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.

Thanks Willem

maintainer Applied
#2 lore raw
In reply to Willem de Bruijn

From: Willem de Bruijn <[email protected]>
Date: Sun, 9 Sep 2018 19:12:12 -0400

Quoted 5 lines

From: Willem de Bruijn <[email protected]>

Convert pr_info to net_info_ratelimited to limit the total number of synflood warnings.

Quoted 7 lines

Commit 946cedccbd73 ("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.

Applied, thanks Willem.

Is this stable material?

#3 lore raw
Quoted 12 lines · David Miller

From: Willem de Bruijn <[email protected]>
Date: Sun, 9 Sep 2018 19:12:12 -0400

Quoted 8 lines

From: Willem de Bruijn <[email protected]>

Convert pr_info to net_info_ratelimited to limit the total number of synflood warnings.

Commit 946cedccbd73 ("tcp: Change possible SYN flooding messages") rate limits synflood warnings to one per listener.

Quoted 8 lines
Quoted 4 lines

Workloads that open many listener sockets can still see a high rate of log messages. Syzkaller is one frequent example.

Applied, thanks Willem.

Is this stable material?

Thanks. Probably not. A process has to keep opening new listeners at high rate while under load. I've only seen syzkaller do that.