From patchwork Wed Nov 4 10:57:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 5590 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:6022:30a9:b0:118:2077:975e with SMTP id f41csp185992laa; Wed, 4 Nov 2026 02:58:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AKwUvBxnGX+w4qk6FFHCacEf3GwRsc6avnFvGJg9LlEgyUznbL7elFUx+G30CptFAHT0gWKzgjjUKJSuwMg=@openvpn.net X-Received: by 2002:a05:693c:820a:b0:361:8d0:6c7a with SMTP id 5a478bee46e88-36a300a4eabmr28133513eec.26.1793789896362; Wed, 04 Nov 2026 02:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1793789896; cv=none; d=google.com; s=arc-20260327; b=UD+1/GEdvgIyQU4xo21EHpw+Pb/gREmj3N1++V/zLq9IoVQH1UMpoAVx19yeATDqDd XjUB2p+LvCGdH2MaX57IM6qP4plLO2hJvdnHI1MICf/RTlcljhVd1I46Mi2TUipzq+E7 vpmXVMZPP9JnXeDinMljU+AZoWWOtEla7d9Nm/c/deHjDBMQJ4tBOb0L9A8LNKpWNZad U7PvBQZlWNqw+EKPf7UiG1jqz73k/D3n0YQAdQGO6GxjL7urmF55U+COvwbHFS5lgnC8 Fyh3ruEFaXTUOez7vy2zmJigePba09/pzvVtJsQnLDKm+/y/6m3gGh/nQA6RwBNX+Bkb L+Jg== 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=hFm4sSJuKfUHiN458cSFztx4y10+PPJtnbJUim5hCfE=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=c/f+RoUa+mXqqq0GuLOfSw9iXtImOjg4zlt0wruhysw2KzU0FF9M91stmrkYKgrGuS pVDAdi/zJVYgcp822vlSSDks4XUK1/KhQWZ83GvioImpPDL4SK7YFpUu6SmqeS0HD6uG W3iiOWhXiZlAVBqI7rWVqRiPv6nT0AF9e8B6CpmILoDwFJkQ47qQsAC9Nubxztmbc/LT ciuhSuKfivtu9xear2bSUKMmb83WxtOKIVcTPp/DW9Xdlq4Oi8i1zvH4WiqfS84/4mxw znpXJ9SZisfHbtIPLrMoadFCciBnkbW62j+1znUPRay+qTYLqhbH+F8sKR1b5EICIKF2 VFGg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=cN9pTrjp; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=KFyyne0Q; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=KFub5E+H; 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-36ca39985a1si7308178eec.70.2026.11.04.02.58.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2026 02:58:16 -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=cN9pTrjp; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=KFyyne0Q; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=KFub5E+H; 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=hFm4sSJuKfUHiN458cSFztx4y10+PPJtnbJUim5hCfE=; b=cN9pTrjp8zLsDY OkGcxV7hIPzvOTDtCtstDMqxJSH990XqdpS1krK0hWPYQHD3Ou3zlcYULgFYucsL9iZdwr/3zZfU2 Lfjknh9x47xcPPMJnHr0R3vPnA8J5J+K6jGQnH1vZlP/2G3cSO5j9C5iejDMuUBLnl02ayem+Us6G T/k=; 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.100.1) (envelope-from ) id 1xOYh5-000000007fu-182T; Wed, 04 Nov 2026 10:58:15 +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.100.1) (envelope-from ) id 1xOYgb-000000007fM-3zXh for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 10:57:45 +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=WWb+IOKYGWtuIFlQ44e0l/Tk0NnrW7EpHJUZHo3w62s=; b=KFyyne0QsVI6WHNi2bcvCAsSyK p9Cf6XrqB3DTVERSYx0bZZ3vReFbXGp5554jl5/wGbQj6R//omL6RtESYn0rsfz5nrjeQcdqEWMvf mflVPiB46IMPW4mPunWbsykRzoE8gOAXTzJQ4Y+22hdeJ7Zhr/FViUPSzP0Oe4KvTOZQ=; 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=WWb+IOKYGWtuIFlQ44e0l/Tk0NnrW7EpHJUZHo3w62s=; b=KFub5E+HUP0APTWuBY60qgqqYR NMJPf3vU1MXyeUENTCto6qteocOBgMAJv/q9HG90/jIpBEJ+i7SyX8iQiF1TNh7rnuwTWExepJkWH UnYeIO4lFc0uK5d/4DHnAE8LM0iGMBupzcq+wkj6IuFXY4QlpR04+2EqmvnB+eV4vkbQ=; 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 1xOYga-000000008Ra-2kIk for openvpn-devel@lists.sourceforge.net; Wed, 04 Nov 2026 10:57:45 +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 6A4Avcio007367 for ; Wed, 4 Nov 2026 11:57:38 +0100 Received: (from gert@localhost) by blue.greenie.muc.de (8.18.2/8.18.1/Submit) id 6A4AvcBG007366 for openvpn-devel@lists.sourceforge.net; Wed, 4 Nov 2026 11:57:38 +0100 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 4 Nov 2026 11:57:32 +0100 Message-ID: <20261104105737.7333-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-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 When the second GetTokenInformation() call failed, the freed buffer was returned. IsUserInGroup() then read it and IsAuthorizedUser() freed it again. Return NULL, which IsUserInGroup() already handles [...] 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: 1xOYga-000000008Ra-2kIk Subject: [Openvpn-devel] [PATCH v1] openvpnserv: don't return freed token groups from GetTokenGroups() 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: 1880925034703530641 X-GMAIL-MSGID: 1880925034703530641 From: Razvan Cojocaru When the second GetTokenInformation() call failed, the freed buffer was returned. IsUserInGroup() then read it and IsAuthorizedUser() freed it again. Return NULL, which IsUserInGroup() already handles by skipping the token group check. Broken since e82733a1 ("Fix user's group membership check in interactive service to work with domains"). Change-Id: I5542520825112dfd64aab332bd76333b74d7fec0 Signed-off-by: Razvan Cojocaru Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2128 --- 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/+/2128 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/src/openvpnserv/validate.c b/src/openvpnserv/validate.c index 6a13a06..2858f62 100644 --- a/src/openvpnserv/validate.c +++ b/src/openvpnserv/validate.c @@ -227,6 +227,7 @@ { MsgToEventLog(M_SYSERR, L"GetTokenInformation"); free(groups); + groups = NULL; } return groups; }