Skip to content

Commit 8af2f06

Browse files
committed
tcp: improve SEG.ACK validation in SYN-RECEIVED
According to the fifth step in SEGMENT ARRIVES, send a RST segment in response to an ACK segment which fails the SEG.ACK check, but leave the endpoint state unchanged. FreeBSD handles this correctly when entering the SYN-RECEIVED state via the SYN-SENT state, but not in the SYN-cache code, which handles the SYN-RECEIVED state via the LISTEN state. This also fixes a panic reported by Alexander Leidinger. Reviewed by: jtl, glebius MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D52934
1 parent 2d18446 commit 8af2f06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sys/netinet/tcp_syncache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,8 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
12851285
"segment rejected\n",
12861286
s, __func__, th->th_ack, sc->sc_iss + 1);
12871287
SCH_UNLOCK(sch);
1288-
goto failed;
1288+
free(s, M_TCPLOG);
1289+
return (0); /* Do send RST, do not free sc. */;
12891290
}
12901291

12911292
TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash);

0 commit comments

Comments
 (0)