Skip to contentSkip to conversation

TCP: check min TTL on received ICMP packets

PATCH Applied Stephen Hemminger 3 participants 4 messages Mar 18, 2010 – Mar 22, 2010

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

PATCH 1/1 TCP: check min TTL on received ICMP packets

This adds RFC5082 checks for TTL on received ICMP packets. It adds some security against spoofed ICMP packets disrupting GTSM protected sessions.

---
Please apply to 2.6.33 since it basically a "follow correct RFC" fix to original GTSM patch.

net/ipv4/tcp_ipv4.c +5 -0
@@ -370,6 +370,11 @@ void tcp_v4_err(struct sk_buff *icmp_skb
 	if (sk->sk_state == TCP_CLOSE)
 		goto out;
 
+	if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
+		NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP);
+		goto out;
+	}
+
 	icsk = inet_csk(sk);
 	tp = tcp_sk(sk);
 	seq = ntohl(th->seq);
maintainer Applied
#1 lore raw

From: Stephen Hemminger <[email protected]>
Date: Thu, 18 Mar 2010 14:27:32 -0700

Quoted 5 lines

This adds RFC5082 checks for TTL on received ICMP packets. It adds some security against spoofed ICMP packets disrupting GTSM protected sessions.

Applied.

Quoted 2 lines

Please apply to 2.6.33 since it basically a "follow correct RFC" fix to original GTSM patch.

Queued up for -stable, thanks!

#2 lore raw
Quoted 14 lines · ----- "David Miller

From: Stephen Hemminger <[email protected]>
Date: Thu, 18 Mar 2010 14:27:32 -0700

Quoted 5 lines

This adds RFC5082 checks for TTL on received ICMP packets. It adds some security against spoofed ICMP packets disrupting GTSM protected sessions.

Applied.

Quoted 2 lines

Please apply to 2.6.33 since it basically a "follow correct RFC" fix to original GTSM patch.

I meant 2.6.34... min_ttl is not in 2.6.33

maintainer
#3 lore raw

From: Stephen Hemminger <[email protected]>
Date: Sat, 20 Mar 2010 17:05:14 -0700 (PDT)

Quoted 8 lines
Quoted 6 lines

From: Stephen Hemminger <[email protected]>
Date: Thu, 18 Mar 2010 14:27:32 -0700

Quoted 2 lines

Please apply to 2.6.33 since it basically a "follow correct RFC" fix to original GTSM patch.

I meant 2.6.34... min_ttl is not in 2.6.33

Gotcha.