From patchwork Wed Nov 18 16:30:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5739 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:b1c3:10b0:11b:d6c:f273 with SMTP id i3-n1csp399078laq; Wed, 18 Nov 2026 08:30:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErGx1D4TGL9c2hrHYblFT3GD8sLW7vFGkslGROJX9do9R6L8vTkJEpAzaP0swtCwUKiSZxy18JIqeos=@openvpn.net X-Received: by 2002:a05:7022:7f0f:b0:160:a80f:3ed2 with SMTP id a92af1059eb24-1b543cb4da7mr2788484c88.10.1795019444115; Wed, 18 Nov 2026 08:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1795019444; cv=none; d=google.com; s=arc-20260327; b=UqP6uL6yFHuE+u58KmQiu+vE+UrLyZjOGAZZ/AD0Fg62USWxWlpFBEw5oa/U0Y9hSB MdG8k9KoObN2BKtFlPNV2Lixhug3hnZcSR0RcNZF8DrCI7IhW+aLu9qm1OYRVci85q6D 4YoRIxN86b7GI7PIANVBn5Ppzu/REDhHZz4j2IHyLy4pDquNKqq+ZaJTJ05varydZIJG DgCNTPZCb4ng6NksW+DT8jFhYY+BM2sj4AU2itc1dVshMYqEi3JxUm+xsOOMemPAZ9lh qUk2ziKHN79gsz1HVVzzUMI8YmV0EDdvB5ofdvGW8+QdG1FNReB+P6cE8y2sh3exz55N Fg5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=DoDy5RiZefje1oDeg3vkFFu1gIvq6DhMY30nwzsC39Q=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=MIJQ4cbV8dXINmLTu4lTdA75T22z6CcgL/Tr0bwRUgsQWDxD81OVNBQtjLAn4yWwpC 4Nuwy9OKM1Uxo2G4E5AOuFmMpSOv+qK+K8eFpELQTucJlKxIwvZ6NaLPaVXAb9kj60S7 PxR+f37COjJI3eURysGxdBGByCrsxspVoVlxs0UfIA0P6pLFhvZiGDwP/+PxMdt3i2aS /ayD+uQsTrdGCtX1iJC5ec47b9XyJgX1XVbCUzDBWjyJKpD/MoeMQ/4g1w9HdxTmZNev uKvS+w/igmPvy32+wF6uedKpQHzH2dw+6Y+Cv3qAu66kithiwoVxTigTET+HrCa3cC8W Snpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=lmOs0ARB; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=E0f5sFi4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kKjmZQlT; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 5a478bee46e88-382a898b5a2si6491857eec.24.2026.11.18.08.30.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Nov 2026 08:30:44 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=lmOs0ARB; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=E0f5sFi4; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kKjmZQlT; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=DoDy5RiZefje1oDeg3vkFFu1gIvq6DhMY30nwzsC39Q=; b=lmOs0ARBR8I6wX J8nSrn9lplyLZ8yVEO6oanMQr6k8b//wIGSzWymVwzbtI/xLEt5lFdy38J5SnJY8X1UhnxczLITIF mYIqQEssON6BIH6EfEe715WV7vy2yMMK+zTkhOdSE9ZuR2tqiuOexZ2Xdhg1zXhecKO+oN2SIZQrG /rs=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xTiYM-000000006uH-26yh; Wed, 18 Nov 2026 16:30:34 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xTiY6-000000006u0-2ATw for openvpn-devel@lists.sourceforge.net; Wed, 18 Nov 2026 16:30:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Unsubscribe-Post:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PVMR1bTJTfrJq48htoPki7ClMLGTTEY5PdGsIenZ9Aw=; b=E0f5sFi4UhkwJoMmNJfRKNPSbp l0KGsK5ebBvtcJnH9noQ5PoKjd/BJtfQwYH1z9CmYN7+F/jhVghEGsvkgs7pO/e0fZ/cnPti7WkA4 iUVZCIMmG/dWC0KFkfREU5yJXzdtsdnKFQMmpLSRnx65IxmIPm1AmrTyrjFQPBD+dOQg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Unsubscribe-Post: List-Subscribe:List-Post:List-Owner:List-Archive; bh=PVMR1bTJTfrJq48htoPki7ClMLGTTEY5PdGsIenZ9Aw=; b=kKjmZQlT9gOBz8p7kyhNyM24G7 2416bhJQvsN2lvic4jzzqp5XqES9s/eQjNU4cuMFHX8TtIkucEM5G/5NfblvQBrilNNLpeFGieuv/ zE+DyKDojn/GNWk4OLczZStSLbqlm5OuwZTxgAkYRfasyZfHp3dAajDsxoUczji1uTnc=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xTiY4-0000000041C-2pMp for openvpn-devel@lists.sourceforge.net; Wed, 18 Nov 2026 16:30:18 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 6AIGU9Sn022754 for ; Wed, 18 Nov 2026 17:30:09 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6AIGU91k022753 for openvpn-devel@lists.sourceforge.net; Wed, 18 Nov 2026 17:30:09 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 18 Nov 2026 17:30:04 +0100 Message-ID: <20261118163009.22733-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Razvan Cojocaru addrlist_match() cast each remote list entry to the peer's address family without checking ai_family. With a dual-stack remote list, an IPv6 peer compared against an IPv4 entry read past the end of it [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1xTiY4-0000000041C-2pMp Subject: [Openvpn-devel] [PATCH v2] socket_util: check the address family in addrlist_match() X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: 1882214308318429209 X-GMAIL-MSGID: 1882214308318429209 From: Razvan Cojocaru addrlist_match() cast each remote list entry to the peer's address family without checking ai_family. With a dual-stack remote list, an IPv6 peer compared against an IPv4 entry read past the end of its sockaddr_in, and 0.0.0.0 matched any IPv6 entry. Skip entries of the other family, as addrlist_port_match() already does. Change-Id: Ic3efcdb7bc4e60a81b9292adfe7f8e22b86e274a Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2215 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2215 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpn/socket_util.h b/src/openvpn/socket_util.h index a1a61af..e85f6fe 100644 --- a/src/openvpn/socket_util.h +++ b/src/openvpn/socket_util.h @@ -312,6 +312,10 @@ const struct addrinfo *curele; for (curele = addrlist; curele; curele = curele->ai_next) { + if (a1->addr.sa.sa_family != curele->ai_family) + { + continue; + } switch (a1->addr.sa.sa_family) { case AF_INET: