From nobody Sat Aug 09 12:21:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bzg4B1rCTz649ch; Sat, 09 Aug 2025 12:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bzg4B0xz2z3kSq; Sat, 09 Aug 2025 12:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754742090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=riA+CyBsJ5Ynt+G44dNnNpIe+CwYj189Oc8BC//fdks=; b=p2aKUmhpEQyau1LCttofB5QDY2YOO05obyztv2l/LZPwVwS42NN+FLjFrSnhxoQzrsbIQC n9lKqV630ACQ1baCy/KGMEQf89ySZlNt5IVZ9IrnUsfFoflLk09xuS1kdWhLkqwLvv5dgg B4wUWnRzj3tE1u6+cCCDgkP4EkpSno+nk5tFycQvxhA0GDz4Y/HNwhnGdSO9hnb48gyygL i5qO5I5l7C1b+Yn03rfkbbx7DVaVVz8GXq5JsqVtawvEkSy8L+vNbFng1kylkvZ/xvwJZh 1YjFEmfFjtpBFnKsYn2W2MHPWcA2TGaRoXcqkOJ7kagAuWC/4R78lUqgZmjxCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1754742090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=riA+CyBsJ5Ynt+G44dNnNpIe+CwYj189Oc8BC//fdks=; b=i3WmFAGTbT3af9/p59JM8+9RdczIephYUXv/z+q0OKFd7M9YOKnrXhtVuyUWKF/55eP4ZW FgYE8nGkslss7x8+S/sN92QXyae+oEJmELXCu1nNyt4ZVc94xKG8iwR2v/0/405M3gh+5o Y/hqXGwHBr/c83uxvJrRg6oISKKVPOvVB6zEt3PMtzvjheSQC5zO2KS5Mu6alY8rpI/T7z OhFteLJNNcaf64bZIUXATv3riYFTFWC7y+SVrM1FDbZp9lOcJOjDtBzqyOJ7/qSZGxLqYc s7JNF9eg1JVTtXK0gbsvO3P0Bad7o76oe9+P1LJd7K3bp53BBSu053YlqmX3Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1754742090; a=rsa-sha256; cv=none; b=AmPxVpFpYFvKjrmz3796TjdSuRliAQ8UChkp3/f7hgydsoCxH26JCi9epGMiQ8cKX3AKvp nXUI7X+3EtSu+EjNYd3sFICvISz4Z6mx/vprM2W5Zs6d3nHpahhIfn+nO6rEtE4rdtRc8e lV5lkDWy2BAO5JvQKsoiEuZKDVPucKTQPAc8fulyGPwSKpvgNqztiAaLswCxeTIvMWMOG4 KW6fqE5BBM8ZQQk31T/icD/lhd0QHHHW4VyaV9OAafFnHIMDisalgDj/XLU+D+cQwZUa6u aDQuScpMBKtHt0fcGRGRn80yz6w3+rnuMFhLOsGKmTT+M+k4P6cUL1LFtvb/fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bzg4B0X5Sz57r; Sat, 09 Aug 2025 12:21:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 579CLUVY098416; Sat, 9 Aug 2025 12:21:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 579CLUu6098405; Sat, 9 Aug 2025 12:21:30 GMT (envelope-from git) Date: Sat, 9 Aug 2025 12:21:30 GMT Message-Id: <202508091221.579CLUu6098405@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: f0f6e5038896 - main - tcp: mitigate a side channel for detection of TCP connections List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0f6e50388963cae44bb92bb69ed7a1135dd2eec Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f0f6e50388963cae44bb92bb69ed7a1135dd2eec commit f0f6e50388963cae44bb92bb69ed7a1135dd2eec Author: Michael Tuexen AuthorDate: 2025-08-09 12:17:38 +0000 Commit: Michael Tuexen CommitDate: 2025-08-09 12:17:38 +0000 tcp: mitigate a side channel for detection of TCP connections If a blind attacker wants to guess by sending ACK segments if there exists a TCP connection , this might trigger a challenge ACK on an existing TCP connection. To make this hit non-observable for the attacker, also increment the global counter, which would have been incremented if it would have been a non-hit. This issue was reported as issue number 11 in Keyu Man et al.: SCAD: Towards a Universal and Automated Network Side-Channel Vulnerability Detection Reviewed by: Nick Banks, Peter Lei MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51724 --- sys/netinet/tcp_subr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 26e7e53d540c..1fce7c591639 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -82,6 +82,7 @@ #include #include #include +#include #ifdef INET6 #include #include @@ -2156,6 +2157,13 @@ tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) sbintime_t now; bool send_challenge_ack; + /* + * The sending of a challenge ACK could be triggered by a blind attacker + * to detect an existing TCP connection. To mitigate that, increment + * also the global counter which would be incremented if the attacker + * would have guessed wrongly. + */ + (void)badport_bandlim(BANDLIM_TCP_RST); if (V_tcp_ack_war_time_window == 0 || V_tcp_ack_war_cnt == 0) { /* ACK war protection is disabled. */ send_challenge_ack = true;