Commit d9d024f9 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: consume incoming skb leading to a reset



Whenever tcp_validate_incoming() handles a valid RST packet,
we should not pretend the packet was dropped.

Create a special section at the end of tcp_validate_incoming()
to handle this case.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7925c2d9
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -5700,7 +5700,7 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
						  &tp->last_oow_ack_time))
				tcp_send_dupack(sk, skb);
		} else if (tcp_reset_check(sk, skb)) {
			tcp_reset(sk, skb);
			goto reset;
		}
		goto discard;
	}
@@ -5736,8 +5736,8 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
		}

		if (rst_seq_match)
			tcp_reset(sk, skb);
		else {
			goto reset;

		/* Disable TFO if RST is out-of-order
		 * and no data has been received
		 * for current active TFO socket
@@ -5746,7 +5746,6 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
		    sk->sk_state == TCP_ESTABLISHED)
			tcp_fastopen_active_disable(sk);
		tcp_send_challenge_ack(sk);
		}
		goto discard;
	}

@@ -5771,6 +5770,11 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
discard:
	tcp_drop(sk, skb);
	return false;

reset:
	tcp_reset(sk, skb);
	__kfree_skb(skb);
	return false;
}

/*