git: 96f544bcc1cb - main - tcp: don't allow to connect a TCP/IPv6 endpoint in TIME WAIT state
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Jul 2025 16:34:37 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=96f544bcc1cb641ab096812c168ebe9136e78c15
commit 96f544bcc1cb641ab096812c168ebe9136e78c15
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2025-07-07 16:29:35 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-07-07 16:29:35 +0000
tcp: don't allow to connect a TCP/IPv6 endpoint in TIME WAIT state
This ensures the TCP/IPv4 and TCP/IPv6 behave the same.
Reported by: syzbot+4de353ba85dac4dcb1ab@syzkaller.appspotmail.com
Reviewed by: Peter Lei
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D51125
---
sys/netinet/tcp_usrreq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 3ea561e63503..687b0d538666 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1520,7 +1520,8 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td)
INP_WLOCK_ASSERT(inp);
if (__predict_false((so->so_state &
- (SS_ISCONNECTING | SS_ISCONNECTED)) != 0))
+ (SS_ISCONNECTING | SS_ISCONNECTED | SS_ISDISCONNECTING |
+ SS_ISDISCONNECTED)) != 0))
return (EISCONN);
if (__predict_false((so->so_options & SO_REUSEPORT_LB) != 0))
return (EOPNOTSUPP);