From patchwork Sat Dec 7 23:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: corubba X-Patchwork-Id: 3977 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1d8b:b0:5dc:2311:f747 with SMTP id hp11csp1758861mab; Sat, 7 Dec 2024 15:17:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWaMH5DyqYVKL+dG4TR+IZIKoa8uPJhI8DxN9VKDJFsMdPLobe5uAYNM4cJ6Zfghj/b3LKNtLKah0U=@openvpn.net X-Google-Smtp-Source: AGHT+IG9bV29ceuJ2cmhfm2lm5hXvELF05BMOSuIWRGbNhpeZBNzXPAvPG0NS6qMdpLDxvxX9WiD X-Received: by 2002:a05:6870:f78a:b0:29e:34dc:b0 with SMTP id 586e51a60fabf-29f733975a0mr4567980fac.25.1733613448151; Sat, 07 Dec 2024 15:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733613448; cv=none; d=google.com; s=arc-20240605; b=GXs2c6oQrqndxT+bV4Rj0qzA5oaBob91ayRd4rR9+e68GJK+NGZZoK9TlMuLrgFCzd UkhYhA4hogCagbsdQ+qJD3TnOEBncIGF/LdeexeMkA0PtBLitMn/jpBzK+OILe4MfC2k dj0j8F4+CghkrJCDIylVImkzu2QRLONmM904CwtssjhjwaBssh+C1/Jh1ToOHWQJhDfO rR2g9wD4nonTOoc+RfIY/LGqXbbJ+GQUqMyTfWvj8QSzkr1Aej6LYndQwHkIZ0FnyvB7 m4hakvssZhUzrDmlHwHwYiXG25Dnqdrp0XuziV+VRLgnla+myjDclJm8fyO3ILnoydrG EPSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:reply-to:from:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:ui-outboundreport:to:content-language:user-agent :mime-version:date:message-id:dkim-signature:dkim-signature :dkim-signature; bh=Q/mdwN6WHQ49Slnst39vrGtEEa5eTk0j/EhXEjfUEKs=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=i96NlpPj3PrAc7arO2cSCO/82/4iMHLEEYo5mwQPTkxHSTxo1+Iv0Gs4KEHjE0R5Rf Wg2gKNUbCsUFUdTvxMH5xq0xjEV22zF+ev53FLupLMiYR0qsS1Bh9DzebTa+I/k5q3OT MTjZKOkx4E7CaOxdHJ+xl7MfrBN1Hh36QGRNKrbqzUZA5+7GLrNjaodWneJAey5l087U BQpcNwMCmnsc8ta70LS6CMCSzyfZXN6+Ri0hk211Ur3pYdd0bg3/3VqdyRnhgC7Qh7oB hWw8hWBnFIh4fXekVadhJuMRiYJYt6IwKDznBfkxu48k+zhcBZB7kasYFiZKXJWm2a6Y rsGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QLa0nZuu; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=lll4Lzb3; dkim=neutral (body hash did not verify) header.i=@gmx.de header.s=s31663417 header.b=aDL7moh8; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 586e51a60fabf-29f569521c5si3083202fac.182.2024.12.07.15.17.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Dec 2024 15:17:28 -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=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=QLa0nZuu; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=lll4Lzb3; dkim=neutral (body hash did not verify) header.i=@gmx.de header.s=s31663417 header.b=aDL7moh8; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tK436-00088s-Et; Sat, 07 Dec 2024 23:17:19 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tK435-00088m-Bc for openvpn-devel@lists.sourceforge.net; Sat, 07 Dec 2024 23:17:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:Subject:From :To:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ywtc4i18e9Lu+ejnlNyrCppn8j4kqWwGaJDQYIIOQLA=; b=QLa0nZuuDx1S4VD/1IZqc6gEyv XlBb12vo0agEgfSUi+9KkgHrlK7nFiqQVrnlecw3wud4RJeBTk+u5WARhFdcGE5HEjzVKuHlBN12k mkPdfSPgjT4ZiWwoC/iGh7vMTddaZmGZ52X4rmsJR2Hf2G2XKlYPf71wcr7RKWTl592w=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:Subject:From:To:MIME-Version:Date: Message-ID:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=ywtc4i18e9Lu+ejnlNyrCppn8j4kqWwGaJDQYIIOQLA=; b=l ll4Lzb3WTs3yrbKkPhcJHJU8E6rn51xwXMJrOC/VgMAm2k+mI+r9NQuWVNCkBZa1CgjAR0oLyNO8a zC9c7FbgZhjy0hFnaOYwXsrX/lyxFEtYyvFABW/G/BGdB4e2wtqHS/W6VC4xqCSGda5eLtkAH+Xqu S0YAaxjuZsnCTtuM=; Received: from mout.gmx.net ([212.227.17.22]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tK433-0000Pu-OP for openvpn-devel@lists.sourceforge.net; Sat, 07 Dec 2024 23:17:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1733613426; x=1734218226; i=corubba@gmx.de; bh=ywtc4i18e9Lu+ejnlNyrCppn8j4kqWwGaJDQYIIOQLA=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:From:Subject: Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=aDL7moh8DGangWRKlaRpgwUZw0l0c9sQJnAuV2NtY+jbB0nXB9W+8tk7qLtJ8NWy I4gDKLsW6mAn3ZZC/VwjH2Ii0Qqb38kjoby76bIaZ5FLEUL1x3LUX2XIkKTixt7Am 6Scrpqfyj/RpuFuJ8q82qFob2hOhmv05Cs4EUeRbZ0DKE2pv8dMSjuIqHotYxO18s Q6+lFLuSSvNSG+DANM1R21OfTO5JT5aO1qQjS7BTAlpG6UHG0g1o+OACcWTUfinvL ggsMBWYPUNyJcXgh5Uv8bXeSoPPC7gPxO5pI4jmNDX04XCyK6GS/4guSc0J+g1Dvb j9zvPJqx+Lx/RJcwTg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.44.3] ([83.135.90.105]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6Udt-1tI86N0qHh-00F6WJ for ; Sun, 08 Dec 2024 00:17:06 +0100 Message-ID: <8de5660b-d917-4092-8871-250495d8c7a4@gmx.de> Date: Sun, 8 Dec 2024 00:17:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: de-CH To: openvpn-devel@lists.sourceforge.net X-Provags-ID: V03:K1:q4PR8bIMFEpdUv3ZF7eHxySYLvFiD/2YYyzM98NfRDw2qInRMB4 nc8Z/VnfcSaLvL/KrT7LESAqHveYCmQ9jIrbYyFtlhKteXWA96pFRhYVUJP86scjRWraPuy hejgRiokN8/NgukgnckrdSWU6TAagGs41UozHgaOdT+gvbVRr7KxFhvsvl3Bpoa/Zb5uaYN ejG7KyvzWHWvKtGEkLJIg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:cSR0K4XunOs=;aJnSjqzETZOjxW6qGhMeBn4ND+5 xLkVOfAWKU4QkEaXOFw/zLZOStP6e4gITlMxEyjoZ8S/4JHCBcjip+hRhybvdUvx2elWKksKS SzeL3KlVouVW71kw6q9NF8koV09H1BpcFpGvYIZN7j89n0T+mpILNufWWyJk2ZjvgNKv14nWf RQ5DSAaMcJ0DBu5MeuN18mnvIv8iau90l60Pftjey/2d8l5Hhv0q/gq5NwpcVM5fNZ246A7aQ vJVzf6ZC02n7ItBj0v0ZW32k+8ootsM4NBl90TjoKJXYgNbrd+Jnw2B6RQ0tkqBFLUEJf/YtP Tw9fE15A+BDr31HcJnDZC3u+dR+V7Zv8034AlS4FB4Scvt+wccxVOYgCNjYqnWMN8dRQBbtcY C27iSn0p/SvPiwKCMf762oca5Vsb40q7+/zqsMYY+t9y2XZo6qxDSma2iTXsvzkXeaZzRnHCS UzeZJ/pFMo9IeoL4v17wA0Q3gs4GlTWa0/lYuNPcRXeojFdcwEyYLWS/nXEDvD0RGnBSwbmua RZRttwN8lXAfZWMozgfeF2gYLj4UTGy2sQcZThexE5+AvfYUiTeEWBiSDqYZKG3iP6kU1OY1J CRejZJW65BuP7cktfCBNS0a8mkBgoWBdEv6DpaXcIn3ieXd8gN+/Yf7dzCbv1LST52kDZnlFN 7I0cS1XDJjT15N9nrBxrfK8h5XmAUtNGmxFWE+/QaH2x4I6Uot+hFkd1w51oWQS/6eJ02+9jY 3Xo4WaskjPCoCupnjcLiCSXrHtOOXgws2t+W/klqz0Ga/9sJDgnkbJ48fHjC+ZRw/xlgE5Qh4 PlZRKf4yqTm6BodA81yIJINyIX2W/TLcUGFrgkuULQp2C+fhGAq8ntbEoCI8swtl2g2fF+JMH K5VCi/AMxgbeX+erDYJQm2aeWyVzdKpiJkQQMh1s2HuiaJ9nATxbfXNPXwI4ZKblHvcClUHIc lG9ighw///AVScTwQc7tL86ZWyJK3TtmFMoM4lwmdQ30ASha+Qnd4oU2KoP7U0mIQca23VNrd kXO0NACKSakdmdzRSLpdnN/kh1mE3Fw+vAi323HtPgz0hHaSBH8mxzcUj4VhJTnw1dz8HgLp8 rKbGnNOtO2Mc/0grH2U/MQIbgEjBed X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", 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: getpeername() and getsockname() will truncate the result if it is larger than the passed-in length. Because here always the size of the `sa` IPv4 union member was passed in, all larger (aka IPv6) resu [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.227.17.22 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.227.17.22 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [corubba[at]gmx.de] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [212.227.17.22 listed in wl.mailspike.net] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Headers-End: 1tK433-0000Pu-OP Subject: [Openvpn-devel] [PATCH 1/2] Fix IPv6 in port-share journal 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: , X-Patchwork-Original-From: corubba via Openvpn-devel From: corubba Reply-To: corubba Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1817825454917479297?= X-GMAIL-MSGID: =?utf-8?q?1817825454917479297?= getpeername() and getsockname() will truncate the result if it is larger than the passed-in length. Because here always the size of the `sa` IPv4 union member was passed in, all larger (aka IPv6) results were truncated. Instead use the size of the `addr` union, which is the maximum size of all union members. The bug was introduced in 0b6450c9. Fixes https://community.openvpn.net/openvpn/ticket/1358 Signed-off-by: corubba Acked-By: Gert Doering --- src/openvpn/ps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.47.1 diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c index 4ca3a129..06bf91a8 100644 --- a/src/openvpn/ps.c +++ b/src/openvpn/ps.c @@ -344,8 +344,8 @@ journal_add(const char *journal_dir, struct proxy_connection *pc, struct proxy_c char *jfn; int fd; - slen = sizeof(from.addr.sa); - dlen = sizeof(to.addr.sa); + slen = sizeof(from.addr); + dlen = sizeof(to.addr); if (!getpeername(pc->sd, (struct sockaddr *) &from.addr.sa, &slen) && !getsockname(cp->sd, (struct sockaddr *) &to.addr.sa, &dlen)) {