From patchwork Mon Nov 2 14:48:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5555 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:3119:b0:118:2077:975e with SMTP id e25csp5509554laa; Mon, 2 Nov 2026 06:49:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvByOV76y+FG5dUfuh0Isi5yNRI+nbWqEZpViQLwrqotWjo+FV5Wh6whLS6Z1uAZkxTEkYVm/n/MpQZQ=@openvpn.net X-Received: by 2002:a05:7301:1a15:b0:355:fdc0:a811 with SMTP id 5a478bee46e88-36a42493bc4mr14460219eec.37.1793630950351; Mon, 02 Nov 2026 06:49:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793630950; cv=none; d=google.com; s=arc-20260327; b=Xka6Iwe+yjB6sZpOpcWqpau5k8Mqxs0zKnbJIfWKCNvNfVJtOc0LZ0hBx7HLIWy4V7 ZtQUN3h5AvGLU/6PtfQxbLNvV72fXc6C+TYQBt/liGkCxTEeB6RmPMcEo1t3aLTiIF4O 3N5fMULJ/UviTpBzLHX83tPoNudVWvi1531weooCOqVFVM115ojC1Z+/EfcF9lzJGLDg WqUF0N4et7DxcQioep0m6b5Jgq8LKlo1OJvUQlVv4d4by2u2SlZAzdfzbykPlYgazTMA d89NdSxO/o7QAl1D9hv9qF2vKARIpYBSHZq6J3I52O5IjNomOAlIilj4JGchVNH8abSk kg0A== 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=TEncv+Bifgg3hrQ2S74U5CWd0oidBhO6759ArNUCbs0=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=H/VXqcgaJpvYpiwocbuQj0rS8QK1ClIQQ/QjJShygeaxxpgsZWpXG3VqDA9DyX/ODs VAlqAqtJK3Qk0flYm4L8qYrGF0o88dKfBYz0Bxmwpcb1IX+3Q935dCCOydtCDOLbE3kI fdgS32cy9Tqs9+f9EEPkb/90F/0XSvE9jzLkCIOGfKk6Af120YQs7GKcoVIQMKzTwY4k awMj+JmMMIR++biDte7wv4zXHGreoEs6XXwTDJ8qg5PzyF45iX9Doo3bueCBJylrvr5B 9eoyngdtpMuGjIbji2gUQKmr2twt1oBeJjfRXltUtPYeDuc3GkqDFeNHUmU3ZiklIUr9 STrQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=L4MOnYjA; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=LKBjeRHy; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=f0t048Bn; 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-36a42b7a619si34012756eec.79.2026.11.02.06.49.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Nov 2026 06:49:10 -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=L4MOnYjA; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=LKBjeRHy; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=f0t048Bn; 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=TEncv+Bifgg3hrQ2S74U5CWd0oidBhO6759ArNUCbs0=; b=L4MOnYjAUfDFxJ iKkBufE54XIpwJTwesd+41vYog3GWXUdQ+2JTS1GirQS772g4q6tvP0tkVW+/QT0a8kl9mkXB21Rl WYvV/XYc/dNtVQAEzeRSQqUpbHQhBRKscL8UkB+ggi4ZRnilHLnk9+ysdwKa06p0TD3hh5jWb740O AHQ=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.100.1) (envelope-from ) id 1xNtLR-000000002N8-0gE6; Mon, 02 Nov 2026 14:49:09 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1) (envelope-from ) id 1xNtLP-000000002MZ-2hBp for openvpn-devel@lists.sourceforge.net; Mon, 02 Nov 2026 14:49:07 +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=McjERsIh5scw81GC4eKekq5ZlO5HBmCIsVzawxvyztk=; b=LKBjeRHynDHDmFj9FSH0ISeWkR cHhFPbDeP2dBh3KdS44nfo4DJ/X+k9yRgeNUbgyF8qKwuN94x4Qc+Nup0UQD+4RvliTvX6ZIUSBmp FFK4XGt5y9m52RkFohcUuKnZ06oVPTCkYbyBKJaLUX6l2Dy8/lbbqsefHC4yDd5KXSNU=; 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=McjERsIh5scw81GC4eKekq5ZlO5HBmCIsVzawxvyztk=; b=f0t048Bnj5xXKNkiOAWbAlLydv WN0yOLJF2zomnXTn6yU++RwMSB9cq0HMCWVZU3YhjxjZh3uEdlJSVG74eweUUeofQW2RV1uZrxKs5 NY/wB4oBNmUGZxvnKmv2YGzlSOnMk5+TXy/9M6D1TxUIhF+2RUL0PLP5id5JXnL5McjM=; Received: from [193.149.48.129] (helo=blue.greenie.muc.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.100.1) id 1xNtL9-000000002GC-1ig4 for openvpn-devel@lists.sourceforge.net; Mon, 02 Nov 2026 14:48:53 +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 6A2EmiB7000935 for ; Mon, 2 Nov 2026 15:48:44 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A2Emi8o000934 for openvpn-devel@lists.sourceforge.net; Mon, 2 Nov 2026 15:48:44 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 2 Nov 2026 15:48:38 +0100 Message-ID: <20261102144844.910-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 The arena used for strerror_win32() was never freed. Allocate it only on the error path, where it is used. Broken since 0213f80e ("Set the correct mtu on windows based systems"). 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: 1xNtL9-000000002GC-1ig4 Subject: [Openvpn-devel] [PATCH v2] tun: free gc arena in windows_set_mtu() 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: 1880758367209918228 X-GMAIL-MSGID: 1880758367209918228 From: Razvan Cojocaru The arena used for strerror_win32() was never freed. Allocate it only on the error path, where it is used. Broken since 0213f80e ("Set the correct mtu on windows based systems"). Change-Id: I80b9969f555d670bc101635318d245d1b2de8ec5 Signed-off-by: Razvan Cojocaru Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2092 --- 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/+/2092 This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index fdd13ae..58f4750 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5203,7 +5203,6 @@ windows_set_mtu(const int iface_index, const short family, const int mtu) { DWORD err = 0; - struct gc_arena gc = gc_new(); MIB_IPINTERFACE_ROW ipiface; InitializeIpInterfaceEntry(&ipiface); const char *family_name = (family == AF_INET6) ? "IPv6" : "IPv4"; @@ -5228,8 +5227,10 @@ if (err != NO_ERROR) { + struct gc_arena gc = gc_new(); msg(M_WARN, "TUN: Setting %s mtu failed: %s [status=%lu if_index=%d]", family_name, strerror_win32(err, &gc), err, iface_index); + gc_free(&gc); } else {