| Message ID | 20261104074751.21336-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp19021laa;
Tue, 3 Nov 2026 23:48:08 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AKwUvByuXm9idiSFx2xgdlReuGF8XhaJW7sDrpAx+ugFMimq+bAY4c6C1LbspBPm8PR9z4sNMoXTp5a+Usw=@openvpn.net
X-Received: by 2002:a05:693c:69d5:b0:369:7c:bfce with SMTP id
5a478bee46e88-36a423c6223mr23835984eec.14.1793778488211;
Tue, 03 Nov 2026 23:48:08 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1793778488; cv=none;
d=google.com; s=arc-20260327;
b=IxiN8Fh20EW6lFSVpz+peD6h+qT9QUgj3HIDqi8c0UNKcN7IOe99ALKPM9ZCpQGutG
fHD0IME5Zw5VpBkzKSPEFYNdEEB5EEvpnPSRkoAuhEVD5BLScJSvm42HKGrpPFvOB/gi
2OXW3IjZ41h3sZLWmXfDkxTuGmQn4skxgpFy8s4hFPQFQnhwwHkAwN4U4hYKBFgnhOxa
OmPQZDqk05oyDZoLMjh4UusJGlUlc1c4Z2d9PoFljRgST4hzYjEnC36RdyF2uWKat5v3
1zHtCL0GZv+ko9qk9gcgbf6zFIlWFGpvoPfurllXWmqnYr+vAREOtGsezLrmBs+YxD5L
xUmg==
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=O/+sRe2sKcN8HIunp+IbaMihhj5AA6LwyPjAuJZZRUc=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=M/+nV6Pt4t2NsospyEKnDPmkwW0+ZsLMz9H3RbnduTDdXqbbsOW2JNexzj5Ibz2QII
BSaV2Qw62lLdofQ1DD0v1IYbsQEqrorXPbtuFqYZhdcESm2vAuHRBE/cqaT1QdN2cefP
hfdydWaqQqOr6ukK4t2aUNFOx4cmd0RBocO0jcuU0pMmWwisrg6h6aPnO6tRa148ZPDj
4cyTNBNyy5QoRbQtwJdPmJejw1FZyR3Is3ceOIcrdRH8bhoLhD8RlqgYK4XPaTRHFucp
mbFPun5U+rf3qqlDb+kM7ydsNhN0OjE0C825mDlVimIKOCziYI83EK8fIqqmeleH29gV
zoqw==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=af1KNUAZ;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=g9+xqYw3;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=jbZmpjWz;
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
a92af1059eb24-1b245c86796si5511823c88.91.2026.11.03.23.48.07
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Tue, 03 Nov 2026 23:48:08 -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=af1KNUAZ;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=g9+xqYw3;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=jbZmpjWz;
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=O/+sRe2sKcN8HIunp+IbaMihhj5AA6LwyPjAuJZZRUc=; b=af1KNUAZn3SQ9h
C7xMOnHfMgAHr/KQjzDNWCXT8gJGYCvh0ebm066gyhv8UtiMooFay5J+k6IiG7rYVzYIGGIA7Z/VD
1ycV/UD66Ru+DrmiEmz9jU7JRlqeUM/Zy7Q56z7e3VhZMrCtNQ0+Lae/AfYKKbN7vmHgpUmSg9lUA
++c=;
Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com)
by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.100.1)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1xOVj3-000000007Un-1KoB;
Wed, 04 Nov 2026 07:48:05 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.100.1)
(envelope-from <gert@blue4.greenie.muc.de>)
id 1xOVj0-000000007Ud-3OAC for openvpn-devel@lists.sourceforge.net;
Wed, 04 Nov 2026 07:48:02 +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=rkpzTRn4oF3b5coqf+opwIjvuqkGpIt3A3K184QqVHg=; b=g9+xqYw3Z1Pg3oaDOo2YhtuSIB
9d/Epo7mnJf1AMnvz9EFWhFae+uBS39z49mgmNvk990jO6zploqrMve9+bE7udp4WsYh6yAbq98Ql
ZiB3/+UfuxMSKhh3yItuDuRevhc8L2wZgZvTaSq/grDW4lWf2w5ZK1ncdIGePZlCGdzM=;
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=rkpzTRn4oF3b5coqf+opwIjvuqkGpIt3A3K184QqVHg=; b=jbZmpjWz4mP5ds+lrI4aP5axKE
ywj5/aSclwB+mFSngyeU14z0F55VRzoQDv9x4YQtjIrYaLpVjKp6TjrCA9Nugnp+rcPORyvMOh2q4
ZFxFVCDQYQGO5B86V5i0gz6SUYJ/xGotaEcLPhEKEuQt781pVLYBZ8OmsS5M0RlI/S7o=;
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 1xOViw-000000000ML-1dQ9 for openvpn-devel@lists.sourceforge.net;
Wed, 04 Nov 2026 07:48:02 +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 6A47lpxh021363
for <openvpn-devel@lists.sourceforge.net>; Wed, 4 Nov 2026 08:47:51 +0100
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A47lpSs021362
for openvpn-devel@lists.sourceforge.net; Wed, 4 Nov 2026 08:47:51 +0100
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 4 Nov 2026 08:47:45 +0100
Message-ID: <20261104074751.21336-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.55.0
In-Reply-To:
<gerrit.1793733834000.Ifc707ef69d614c3408b6f88c780e337e95baafac@gerrit.openvpn.net>
References:
<gerrit.1793733834000.Ifc707ef69d614c3408b6f88c780e337e95baafac@gerrit.openvpn.net>
MIME-Version: 1.0
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-1.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 <razvanc@mailbox.org> The DACL from
SetEntriesInAcl() and the pipe security descriptor from
ConvertStringSecurityDescriptorToSecurityDescriptorW()
were never freed, leaking both on every client connection. Initialize them
[...] 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: 1xOViw-000000000ML-1dQ9
Subject: [Openvpn-devel] [PATCH v1] openvpnserv: free security descriptors
in RunOpenvpn()
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: 1880913071816381469
X-GMAIL-MSGID: 1880913071816381469
|
| Series |
[Openvpn-devel,v1] openvpnserv: free security descriptors in RunOpenvpn()
|
|
Commit Message
Gert Doering
Nov. 4, 2026, 7:47 a.m. UTC
From: Razvan Cojocaru <razvanc@mailbox.org> The DACL from SetEntriesInAcl() and the pipe security descriptor from ConvertStringSecurityDescriptorToSecurityDescriptorW() were never freed, leaking both on every client connection. Initialize them to NULL at the top and LocalFree() them at out. DACL leaked since a24dd2e3 ("interactive service v3"), pipe security descriptor since 0a429cb1 ("Restrict access to the service pipe to SYSTEM and owner"). Change-Id: Ifc707ef69d614c3408b6f88c780e337e95baafac Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org> Acked-by: Heiko Hund <heiko@openvpn.net> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2111 --- 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/+/2111 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Heiko Hund <heiko@openvpn.net>
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 484f27c..4ddc354 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -3444,7 +3444,8 @@ .lpSecurityDescriptor = NULL, .bInheritHandle = TRUE }; - PACL ovpn_dacl; + PACL ovpn_dacl = NULL; + PSECURITY_DESCRIPTOR pSD = NULL; EXPLICIT_ACCESS ea[2]; SECURITY_DESCRIPTOR ovpn_sd; SECURITY_ATTRIBUTES ovpn_sa = { .nLength = sizeof(ovpn_sa), @@ -3624,7 +3625,6 @@ */ SECURITY_ATTRIBUTES sa; - PSECURITY_DESCRIPTOR pSD = NULL; LPCWSTR szSDDL = L"D:(A;;GA;;;SY)(A;;GA;;;OW)"; if (!ConvertStringSecurityDescriptorToSecurityDescriptorW( szSDDL, SDDL_REVISION_1, &pSD, NULL)) @@ -3764,6 +3764,8 @@ free(ovpn_user); free(svc_user); free(cmdline); + LocalFree(pSD); + LocalFree(ovpn_dacl); DestroyEnvironmentBlock(user_env); FreeStartupData(&sud); CloseHandleEx(&proc_info.hProcess);