From patchwork Fri Nov 6 16:22:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5609 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp3522178laa; Fri, 6 Nov 2026 08:23:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFW7IObDckluSY8KvBqcVN1Dp3mmhJtjFF+MF4sN10jXxJI+Zut5VkkThjc1kjE02UMSNaOtEIhGho=@openvpn.net X-Received: by 2002:a05:7300:8281:b0:369:f2f4:b227 with SMTP id 5a478bee46e88-36f75b1ffd2mr3353840eec.18.1793982185876; Fri, 06 Nov 2026 08:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793982185; cv=none; d=google.com; s=arc-20260327; b=LSKjlakCYQe+V3Z2Ie4ai/Qju8vXFES2psqAIxBYRSNPX7jfSuvQW8ijeH4NhKitjm 3CjgRbiHNNyFHav1iJiMUGAvi/hWnI28gbC96EJRPUxjaf2mf39BuG0kd2xE+RK6ttWK QmQiviEXX6ZJWCyz2ncgIuym5SHvH0H9rS6jaY/5zRYSFhfmY++4eKs8RcHjAQ0Lz/HU TlTzR05HrT9W0utDmGE1urRM99zJRX+LNSYpDtTnoIL3GhT9RQ9bhzhiPuO98Cl34TtN Ur857vp9Ld+F3YnSIoDzgenSBK1E71Ov7GcM1tACo5QLAcF3eVCG4oB2UoCozAkQNh2i G/3Q== 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=rbEV/WKVxzCFQ2//tGBJ3H/3S97E7Pxe/6GbgCTp4Pw=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=ksZ9DKdiJ5PzNyaMFlVYPgdFSlWZ0CUZnJ+nyCEToWSTbKFhBQVmsIXa/UENudiHiL W+WaYWOzDsodxTr5VWJWIBvCJoSBUaOk4xuc5orArsn7KnHn4Ov2+TMNwS+9CY/2ds+A 1ELzRCAhuLNKLdm2QXOM+LN2z63XJwOmMwM4xWPOD/RNoK7wm9CBDcbWqUwtCqX3daQM 67yxcKDuAb7JLW02T2zduyiYB4YRGM0JxQLfMMhvxTi6rGszdltVUJvKyLSh9wmGm7gb NkzdRswnVLsbyBglXbfCAJT9uxu73YWTuPzNmWcHfAPwBplH8BEXVM69KxnJarlg5kjr lcsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=GbJCK3qT; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jgWNho7p; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="RK/ButuD"; 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-36f6bf8564fsi7414236eec.27.2026.11.06.08.23.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Nov 2026 08:23:05 -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=GbJCK3qT; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=jgWNho7p; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b="RK/ButuD"; 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=rbEV/WKVxzCFQ2//tGBJ3H/3S97E7Pxe/6GbgCTp4Pw=; b=GbJCK3qTiQcbTX reTsyhtOJQ9G9ohxGDnSyMlyJumbyjt8BACkFyNJalvDZHVBJ4b+xRpuHNidGKGG+ERbCE61AWRXN kpN2WTcjSd2ArDmWPUjKcr1RKbS2FesxmESUFABqJZPPKzW6EuL3sa27RdpZYfZxUwKR/lummsBvK htY=; 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 1xPMiT-000000002qV-3XEk; Fri, 06 Nov 2026 16:23:01 +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 1xPMiR-000000002qJ-37vq for openvpn-devel@lists.sourceforge.net; Fri, 06 Nov 2026 16:22:59 +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=e7tqP4F54dJ/QBh3d6C/qFjfwEv/tt1/pjOsI2VcH68=; b=jgWNho7pPGJpDnBI2KtvNDcKWc giilfLVy3exDvAwAmQcV/Q109S84PzjxgDJ9gTzmzulT22dxUT7qCG+kNRuWy2d0qXrCXSkAbQKal OBFTh+5cvqEcbVRJeBwMGUKVgAN8nXm0OrZFVRNm1Kzq7y8VJkfA6/GiVGoE+ugHcBNE=; 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=e7tqP4F54dJ/QBh3d6C/qFjfwEv/tt1/pjOsI2VcH68=; b=RK/ButuDbDybYP+OtFq7BUxBXy 6Bw1T61v8LcCda7R5HZ50fGQt2bYkl40GU9g5QqWZv7cQP7jMmewPMfjJ7EVtGtbISNpTm803RlMs QkCTDCUYzPFq0MHwht/oWMoxx20cUmbcujj8lcBScyynXD/SF3VgdbLV6rjBg7sestCc=; 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 1xPMiQ-000000007Pu-1r4M for openvpn-devel@lists.sourceforge.net; Fri, 06 Nov 2026 16:22:59 +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 6A6GMpMS002942 for ; Fri, 6 Nov 2026 17:22:51 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A6GMpcJ002941 for openvpn-devel@lists.sourceforge.net; Fri, 6 Nov 2026 17:22:51 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Fri, 6 Nov 2026 17:22:44 +0100 Message-ID: <20261106162251.2926-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 key opened by OpenNrptBaseKey() was never closed, leaking a registry handle on every NRPT add message. Close it at the common exit, and return directly if opening fails, as the key is not set then [...] 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: 1xPMiQ-000000007Pu-1r4M Subject: [Openvpn-devel] [PATCH v1] openvpnserv: close the NRPT base key in HandleDNSConfigNrptMessage() 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: 1881126664289079839 X-GMAIL-MSGID: 1881126664289079839 From: Razvan Cojocaru The key opened by OpenNrptBaseKey() was never closed, leaking a registry handle on every NRPT add message. Close it at the common exit, and return directly if opening fails, as the key is not set then. Broken since 0f3b7d17 ("win: implement --dns option support with NRPT"). Change-Id: Ib7b9f2994ca828ea699bc6e5b08193dd30965926 Signed-off-by: Razvan Cojocaru Acked-by: Frank Lichtenheld Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2144 --- 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/+/2144 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Frank Lichtenheld diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 6a83bac..81205d6 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -3014,7 +3014,7 @@ LSTATUS err = OpenNrptBaseKey(&key, &gpol_nrpt); if (err) { - goto out; + return err; } /* Add undo information first in case there's no heap left */ @@ -3065,6 +3065,7 @@ ApplyDnsSettings(gpol_nrpt || gpol_list); out: + RegCloseKey(key); return err; }