Jerry Chu 37561f68bd tcp: Reject invalid ack_seq to Fast Open sockets
A packet with an invalid ack_seq may cause a TCP Fast Open socket to switch
to the unexpected TCP_CLOSING state, triggering a BUG_ON kernel panic.

When a FIN packet with an invalid ack_seq# arrives at a socket in
the TCP_FIN_WAIT1 state, rather than discarding the packet, the current
code will accept the FIN, causing state transition to TCP_CLOSING.

This may be a small deviation from RFC793, which seems to say that the
packet should be dropped. Unfortunately I did not expect this case for
Fast Open hence it will trigger a BUG_ON panic.

It turns out there is really nothing bad about a TFO socket going into
TCP_CLOSING state so I could just remove the BUG_ON statements. But after
some thought I think it's better to treat this case like TCP_SYN_RECV
and return a RST to the confused peer who caused the unacceptable ack_seq
to be generated in the first place.

Signed-off-by: H.K. Jerry Chu <hkchu@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-10-23 02:42:56 -04:00
..
2012-10-08 17:42:35 -04:00
2012-10-01 18:39:44 -04:00
2012-04-15 12:37:19 -04:00
2011-10-19 03:10:46 -04:00
2012-10-08 17:42:36 -04:00
2012-10-01 17:35:31 -04:00
2012-07-30 14:53:21 -07:00
2012-10-08 17:42:36 -04:00
2012-10-12 13:56:52 -04:00
2012-09-25 13:22:30 -04:00
2012-10-06 03:04:45 +09:00
2012-07-31 18:42:43 -07:00
2012-01-20 14:17:26 -05:00
2012-01-20 14:17:26 -05:00
2012-05-17 14:59:59 -04:00
2012-10-22 15:16:06 -04:00
2011-03-31 11:26:23 -03:00
2011-03-31 11:26:23 -03:00
2012-10-22 15:16:06 -04:00
2012-03-11 23:42:51 -07:00
2012-04-15 12:37:19 -04:00
2012-10-08 17:42:36 -04:00