Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97e3ecd1 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller
Browse files

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.

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 10414444
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -370,6 +370,11 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
	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);