Article View: linux.kernel.netdev
Article #6162[PATCH] tcp: fix authentication bypass via unsupported TCP auth options
From: Jérémy Jean
Date: Wed, 21 Oct 2026 19:31
Date: Wed, 21 Oct 2026 19:31
50 lines
11056 bytes
11056 bytes
tcp_inbound_hash() parses both TCP-MD5 and TCP-AO options when at
least one of the two features is enabled. With TCP_MD5SIG=y and
TCP_AO=n, a packet with an AO option reaches the disabled
tcp_inbound_ao_hash() stub. That stub returns success, so sockets
configured to require MD5 authentication end up accepting
unauthenticated data.
The inverse configuration with TCP_MD5SIG=n and TCP_AO=y has the same
problem for an MD5 option on AO sockets.
Make the disabled stubs reject options for the unsupported
authentication scheme.
Fixes: 0a3a809089eb ("net/tcp: Verify inbound TCP-AO signed segments")
Cc: stable@vger.kernel.org
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
---
include/net/tcp_ao.h | 2 +-
net/ipv4/tcp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/tcp_ao.h b/include/net/tcp_ao.h
index 9a2333e62e994..bb249d6df8723 100644
--- a/include/net/tcp_ao.h
+++ b/include/net/tcp_ao.h
@@ -303,7 +303,7 @@ static inline enum skb_drop_reason tcp_inbound_ao_hash(struct sock *sk,
const struct request_sock *req, int l3index,
const struct tcp_ao_hdr *aoh)
{
- return SKB_NOT_DROPPED_YET;
+ return SKB_DROP_REASON_TCP_AOUNEXPECTED;
}
static inline struct tcp_ao_key *tcp_ao_do_lookup(const struct sock *sk,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 87ef6d5cbfeba..7d800b6283bd2 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -4962,7 +4962,7 @@ tcp_inbound_md5_hash(const struct sock *sk, const struct sk_buff *skb,
const void *saddr, const void *daddr,
int family, int l3index, const __u8 *hash_location)
{
- return SKB_NOT_DROPPED_YET;
+ return SKB_DROP_REASON_TCP_MD5UNEXPECTED;
}
#endif
--
2.47.3
Technical Details
Message-ID:
<20261021193151.1819085-2-Jeremy.Jean@oss.cyber.gouv.fr>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350216-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350216-linux-kernel-netdev=dewy.ru From: Jeremy.Jean@oss.cyber.gouv.fr (Jérémy Jean) Newsgroups: linux.kernel.netdev Subject: [PATCH] tcp: fix authentication bypass via unsupported TCP auth options Date: Wed, 21 Oct 2026 19:31:51 +0000 Organization: Usenet Network Message-ID: <20261021193151.1819085-2-Jeremy.Jean@oss.cyber.gouv.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="46014"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:V3/z5O9qb0quHiswMDavdMJfdLI= sha256:NhHHGeEfEJSkGgu07VGbGjTJVRdePhWX+1mtxpLnmg8= sha1:fXA8Yr1vGwVuTyMac2hzM8TM1bk= sha256:BKsHIvSvynjzHjwZc0vFZ2NgRRDmbkSwu9WUXiUa/Pg= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Source X-Source-Args X-Source-Dir X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 6F0651110FA; Wed, 21 Oct 2026 22:33:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=oss.cyber.gouv.fr X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 76oFlUj71G2f; Wed, 21 Oct 2026 22:33:42 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350216-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=oss.cyber.gouv.fr X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 339B7110FF1; Wed, 21 Oct 2026 22:33:33 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 605A03E3CA; Wed, 21 Oct 2026 19:32:20 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792611140; b=lRRsKAdifXifqvA2AOxiU9QnbRgyktPDYh5lrZUJZW2yhxL3hh2DfOxLS/ZT4EYLKNf9 djbs1CH1pktXDAd0BS+8fLpMd/HKePWVmFaVlTAfZTUb30dwdZ4I++lVgKTFyynV8FkI4 sAcS489gW2MPMluzoiBkOJ39lAXTnMR853H4/6aujl9P+u2BfCB8F9zZ7Z7b7y57TK8hG jHukrqhi2CiuN8mFg4AVYR65rXM8YgS4aTFX0RTkkGhK+ewgaivi7xFdUi1oYHAJ5xfjy N4yj+FwnSgwq/fRb4aapvK+fR/8eyf0LdCC//eUI77DJe1G0B73Z7BBwE2hT8rSdwJQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792611140; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Transfer-Encoding:X-AntiAbuse: X-AntiAbuse:X-AntiAbuse:X-AntiAbuse:X-AntiAbuse: X-Get-Message-Sender-Via:X-Authenticated-Sender:X-Source: X-Source-Args:X-Source-Dir; bh=glPt0q0sEevcWyTh7Wmw1AfhAylbAzS5O8HfQusylb4=; b=j0Wa3U391QNvNvsE630GgiD06+eItkS3PMgScxq6U5Imayyq698hzQySAgYm4uP6Y2sR teeOz9pm7BV8Zfv0YWm6/rP6yG4KGsJE9xnxHmEdBRRLsXuCjBSXhp5U5tqvkKY+6oy1D ASRcytzFDLqLsjPCCXvhlb7HeHqz9j7m0Ks4OYxRXqjBcK8Xy2ZXGt7NiIzS6pRnDpfQ7 PNHvc18JyxeEfbUtg40C+26fXIPOZQLo9Npl2dbvEGVyQbyloL4nLIZN3HE6jkYMc7EqC lTH7tlGwKmQQGZ9hiRsZ4VmzQAWxQ4apmD7w5K23KRFy6g83CmtpYKsjbKc1f1icL6A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=oss.cyber.gouv.fr header.i=@oss.cyber.gouv.fr header.a=rsa-sha256 header.s=default header.b=Jgok1qRk; dmarc=pass header.from=oss.cyber.gouv.fr; spf=pass smtp.mailfrom=oss.cyber.gouv.fr; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A8F0606A323; Wed, 21 Oct 2026 19:32:20 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=oss.cyber.gouv.fr header.i=@oss.cyber.gouv.fr header.a=rsa-sha256 header.s=default header.b=Jgok1qRk X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=51.159.188.251 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792611134; b=f+3HMC3CTP8MdFlOiWHEQePOs7HwnvzKD2Fj0ZTUg3WKq3eI/abkuCC4l/yFDlQmHE1f c8vy+B5XwB1A9O5ojiHPvAa+Gkewq4HG2vRC8jMQ4e7qwPrKMN/DNIYgmqf4OzyEXAuRD /RxckBT1gkoOW7p8dKiVJPiGuRWIxB6g4jA1JolQaAx7nThm9nGTqN4sUoY9etDTCQ/jz dz6BeKJs771ei+6HHNmpxxnt/Kn6vjwRm9ZnSVSu/LUX25W+Oi+L8TQlq2GjyECQQZb76 QGyO9cySWNkglz1fieLLb3lxhW0e81G7fEXDErDXf6CQ53xHff014TN5RY/mKCZfQNA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792611134; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding:X-AntiAbuse:X-AntiAbuse:X-AntiAbuse: X-AntiAbuse:X-AntiAbuse:X-Get-Message-Sender-Via: X-Authenticated-Sender:X-Source:X-Source-Args:X-Source-Dir; bh=glPt0q0sEevcWyTh7Wmw1AfhAylbAzS5O8HfQusylb4=; b=LOWoedLXhkCNqHOgr6GztkzS6YMmpc1Sl/heEl01SWgQt2qhHdOUk1heSabDTe0a9eb+ JBjvHbqdTMiQF1XoFBXJyJWOckCqQhi/cQewHdEgPtJgvq+IP2MKmw4x+6hp/IQ8AcypV EiT/rcph06hTa1qNkJOY+/+VAC/h0aw7fuP0M15mNBMed782f1L/qlo1xVZvu83b8qQWj qxZw9YofOqnESozwINaCR/LYjm6a4nhRExqS8o2Pmot4rcggwrq/YPfWMDBaMvfQciKwo JSP5gntRsy732oJOEw5ioWycllclLJrBkT9RSNsUcFVopOfnKUTaatC1jRfJItylUsw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.cyber.gouv.fr; spf=pass smtp.mailfrom=oss.cyber.gouv.fr; dkim=pass header.d=oss.cyber.gouv.fr header.i=@oss.cyber.gouv.fr header.a=rsa-sha256 header.s=default header.b=Jgok1qRk; arc=none smtp.remote-ip=51.159.188.251 X-Received: from oss.cyber.gouv.fr (oss.cyber.gouv.fr [51.159.188.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F991606A31A; Wed, 21 Oct 2026 19:32:13 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8F991606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.cyber.gouv.fr X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.cyber.gouv.fr X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=oss.cyber.gouv.fr; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Sender:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=glPt0q0sEevcWyTh7Wmw1AfhAylbAzS5O8HfQusylb4=; b=Jgok1qRka7m3Ny+nJm0meHOnkc Nf0BBPjUNwHjm6T+aAYuIYZIpPyTM8FunG1zC+1wyvbB4ag7JeoDrIVhg52NxobRrt+Vn3hybOSVY u15HIBQo22DpgilnRtzoTRoMG2/yQE5DTHaf2zi6U7FOyT6MgcBHN4pNanvpVewkgZg+pwsjFz6Av L+QBUxDTh5CBQgPzbyF59Lbj2kAtON7vg3LJK9L0PvM9+oNS5Ups5qZietl6VvBS1K/KFv44iYPdD IdMyOo1XrfmHoYyOKu+hTjKJ+sXLM2fu19cT9eA06IEtylNYQVrdco9rCnFBhn/3whjeKbGKEXMe5 phYK9zbg==; X-Received: from [151.115.150.205] (port=32912 helo=gepetto..) by pf-012.whm.fr-par.scw.cloud with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from <Jeremy.Jean@oss.cyber.gouv.fr>) id 1xJc2i-0000000DCTL-2bbn; Wed, 21 Oct 2026 21:32:06 +0200 X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>, stable@vger.kernel.org X-Mailer: git-send-email 2.47.3 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - pf-012.whm.fr-par.scw.cloud X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - oss.cyber.gouv.fr X-Get-Message-Sender-Via: pf-012.whm.fr-par.scw.cloud: authenticated_id: jeremy.jean@oss.cyber.gouv.fr X-Authenticated-Sender: pf-012.whm.fr-par.scw.cloud: jeremy.jean@oss.cyber.gouv.fr