From: "stipa (Code Review)" Date: Thu, 17 Apr 2025 11:51:44 +0000 In-Reply-To: References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., antonio@...2726... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="lW71ceocA2E="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: ssl_openssl.c: Prevent potential double-free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --lW71ceocA2E= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, ordex, plaisthos, stipa. Hello flichtenheld, ordex, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/942?usp=3Demail to look at the new patch set (#4). The following approvals got outdated and were removed: Code-Review-1 by ordex Change subject: ssl_openssl.c: Prevent potential double-free ...................................................................... ssl_openssl.c: Prevent potential double-free Fixes a potential double-free issue in tls_ctx_load_cert_uri() by explicitly nullifying the pointer immediately after calling OSSL_STORE_I= NFO_free(info). This ensures that subsequent cleanup won't attempt to free the same pointer= again. GitHub: #726 Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1 Signed-off-by: Lev Stipakov --- M src/openvpn/ssl_openssl.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/942/4 diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index d1d5d3e..f7be50c 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -1152,6 +1152,7 @@ goto end; } OSSL_STORE_INFO_free(info); + info =3D NULL; /* iterate through the store and add extra certificates if any to the = chain */ while (!OSSL_STORE_eof(store_ctx)) @@ -1170,6 +1171,7 @@ break; } OSSL_STORE_INFO_free(info); + info =3D NULL; } end: -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/942?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4507be07cd5573b2117e837ef03187535a38a4b1 Gerrit-Change-Number: 942 Gerrit-PatchSet: 4 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-Attention: stipa Gerrit-MessageType: newpatchset --lW71ceocA2E= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, ordex, plaisthos, s= tipa.

stipa uploaded patch set #4 to this change.

View Change

The following approvals got outdated and were removed: Code-Review-1 by ordex

ssl_openssl.c: Prevent potential double-free

= Fixes a potential double-free issue in tls_ctx_load_cert_uri()
by explic= itly nullifying the pointer immediately after calling OSSL_STORE_INFO_free(= info).

This ensures that subsequent cleanup won't attempt to fre= e the same pointer again.

GitHub: #726

Change-Id: I4507be07cd= 5573b2117e837ef03187535a38a4b1
Signed-off-by: Lev Stipakov <lev@...1387...= 5...>
---
M src/openvpn/ssl_openssl.c
1 file changed, 2 inserti= ons(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/op=
envpn refs/changes/42/942/4
diff --git a/src/openvpn/ssl_openssl.c =
b/src/openvpn/ssl_openssl.c
index d1d5d3e..f7be50c 100644
--- a/src/openvpn/ssl_openssl.c
+++ b/src/op= envpn/ssl_openssl.c
@@ -1152,6 +1152,7 @@
= goto end;
}
OSSL_STORE_IN= FO_free(info);
+ i= nfo =3D NULL;

/* iterate through the= store and add extra certificates if any to the chain */
= while (!OSSL_STORE_eof(store_ctx))
@@ -1170,6 +1171,7 @@=
break;
}
<= span> OSSL_STORE_INFO_free(info);

+ info =3D NULL;
}<= br>
end:

To vie= w, visit = change 942. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4507be07cd5573b2117e837ef03= 187535a38a4b1
Gerrit-Change-Number: 942
Gerrit-PatchSet: 4
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: ordex <antonio@...2726...= >
Gerrit-Attention: stipa <lstipakov@...1663...= .>
Gerrit-MessageType: newpatchset
--lW71ceocA2E=--