Skip to content

Commit

Permalink
tcp: accept RST without ACK flag
Browse files Browse the repository at this point in the history
commit c3ae62a (tcp: should drop incoming frames without ACK flag
set) added a regression on the handling of RST messages.

RST should be allowed to come even without ACK bit set. We validate
the RST by checking the exact sequence, as requested by RFC 793 and
5961 3.2, in tcp_validate_incoming()

Reported-by: Eric Wong <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Neal Cardwell <[email protected]>
Tested-by: Eric Wong <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Jan 11, 2013
1 parent cb59c87 commit 7b514a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -5543,7 +5543,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
if (len < (th->doff << 2) || tcp_checksum_complete_user(sk, skb))
goto csum_error;

if (!th->ack)
if (!th->ack && !th->rst)
goto discard;

/*
Expand Down Expand Up @@ -5988,7 +5988,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
goto discard;
}

if (!th->ack)
if (!th->ack && !th->rst)
goto discard;

if (!tcp_validate_incoming(sk, skb, th, 0))
Expand Down

0 comments on commit 7b514a8

Please sign in to comment.