From nobody Fri Sep 5 18:58:18 2025 X-Original-To: dev-commits-src-all@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 4cJQbZ4vT2z66FN2; Fri, 05 Sep 2025 18:58:18 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cJQbZ2YK5z3Lhj; Fri, 05 Sep 2025 18:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757098698; 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=bfK/ACvrAFyFHj/MZaABogeJHOT58ZPoIQ2Wy2Vf2y4=; b=XkboO2RYmnu3tAbIyQ8ZU8vJE9Lzai0Yf4S343U4q2iEBCHlyXmSnWsbQ4cY8xa7XKnGQ/ nRS1mxRICUIT2o02FQDpdavNLcES/22XyVj5d6tabID4kvjwyJfzTYH7KZ89r1VGfQX0Ru VFxNbJ5H5GZQAT0nk519+xkrLLQxIKsFnqLpKGNEZ99v62zu9CRfEYNVM7Fad657kwT4S+ WfHRVDWNKkShwLT8v7lr04mt3jNVg+QpAJ+qi1mMrI3UHmUtuR5yX6gZel8obiwLUN2YIX 2I0v+uZdQKZhj+x+rS2kuvayPygbmeDs3fKX975LJaI0RFoRwhecKxWok+qBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757098698; 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=bfK/ACvrAFyFHj/MZaABogeJHOT58ZPoIQ2Wy2Vf2y4=; b=ymORzS22H5RwQYvaHX065tOaxrHVBtGMOD+MBbc9XK5lhGpd6cDBkmTuWbelro+G5qYRsu kotG/nGtRR0Kvnw7ckNDubZeScaNANP9JfFDy0rmN+jbZLw3DDsYayLMNSn5rCjCBqB5hu 0q1QeNpl3Sw86iY2w+5XWj+ohTqPPQvoFaMlb8Yze5+RdPXW/X4asIF6kTXQ6oi26OCGWd whux/bRrYRKsNDeK16sWB37qeAsIoeaAgtRbaI617kRkT4vXu+rrUqU30gSyRDONlDl/NV RegZSbs6BWXKAO4og18TuPypfbG6ArAIYJsCB0tov0IIT97UO5qQGTkGBUcyUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757098698; a=rsa-sha256; cv=none; b=hoy7QpgVh/2KdReY46dmFN2HWwL/0llIA78v30F8uOutqgfhC9rCNlUkw0/HZG47nUiinS 0CNYPdiWNzQXPkpzb3+iXYpmAvTUv66qMtB1dK5YYmEDQ6CuamkEoyBg0g8aGc204R0HTy 93PZTlwjqMCTqEbI1wiGgygIrNoxomHZxQLrAIjsAG0DJYO9AmWjJHqmI4omrjpx2S6pYs 2vAKp0+ybb4EwAgZ53PYWwK0hN02SBjtKb/TUiCIa6kHB9hwhd70XT2xmtcqQdnlhuSRfW vOty3cHMkkZv6b1+R8gHQbQBS49BGeh97fCMnQ/yM9RtTmBUwt4KM+DisvxULw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cJQbZ27Prz11fS; Fri, 05 Sep 2025 18:58:18 +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 585IwIQn018389; Fri, 5 Sep 2025 18:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 585IwIcv018384; Fri, 5 Sep 2025 18:58:18 GMT (envelope-from git) Date: Fri, 5 Sep 2025 18:58:18 GMT Message-Id: <202509051858.585IwIcv018384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: d1ab6d36aeb2 - stable/14 - tcp: mitigate a side channel for detection of TCP connections List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d1ab6d36aeb21091f7a442ca78aa2ca9a8941875 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d1ab6d36aeb21091f7a442ca78aa2ca9a8941875 commit d1ab6d36aeb21091f7a442ca78aa2ca9a8941875 Author: Michael Tuexen AuthorDate: 2025-08-09 12:17:38 +0000 Commit: Michael Tuexen CommitDate: 2025-09-05 18:57:52 +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 Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D51724 (cherry picked from commit f0f6e50388963cae44bb92bb69ed7a1135dd2eec) --- 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 d17b46d13038..6a9a4635cee7 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -85,6 +85,7 @@ #include #include #include +#include #ifdef INET6 #include #include @@ -2230,6 +2231,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;