From: "plaisthos (Code Review)" Date: Sat, 11 Nov 2023 14:21:43 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <57300481a334c57d0e58724244054e36d01a30a2-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="ONgxSD8WOB0="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Do not check key_state buffers that are in S_UNDEF state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: openvpn-devel --ONgxSD8WOB0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/426?usp=3Demail to review the following change. Change subject: Do not check key_state buffers that are in S_UNDEF state ...................................................................... Do not check key_state buffers that are in S_UNDEF state When a key_state is in S_UNDEF the send_reliable is not initialised. So checking it might access invalid memory or null pointers. Change-Id: I226a73d47a2b1b29f7ec175ce23a806593abc2ac --- M src/openvpn/ssl.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/26/426/1 diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index cee4afe..24f2bab 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3189,6 +3189,11 @@ for (int i =3D 0; i < KS_SIZE; i++) { struct key_state *ks =3D &session->key[i]; + if (ks->state =3D=3D S_UNDEF) + { + continue; + } + for (int j =3D 0; j < ks->send_reliable->size; j++) { if (ks->send_reliable->array[i].buf.data =3D=3D dataptr) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/426?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: I226a73d47a2b1b29f7ec175ce23a806593abc2ac Gerrit-Change-Number: 426 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --ONgxSD8WOB0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

Vi= ew Change

Do not check key_state buffers that are in S_UNDEF state
<= br>When a key_state is in S_UNDEF the send_reliable is not initialised. So<= br>checking it might access invalid memory or null pointers.

Change-= Id: I226a73d47a2b1b29f7ec175ce23a806593abc2ac
---
M src/openvpn/ssl.c=
1 file changed, 5 insertions(+), 0 deletions(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/26/426/1
diff --git=
 a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index cee4afe..24f= 2bab 100644
--- a/src/openvpn/ssl.c
+++ b/s= rc/openvpn/ssl.c
@@ -3189,6 +3189,11 @@
= for (int i =3D 0; i < KS_SIZE; i++)
{
<= span> struct key_state *ks =3D &session->key[i];
<= span style=3D"color: hsl(120, 100%, 40%);">+ if (ks->state =3D=3D= S_UNDEF)
+ {<= /span>
+ continue= ;
+ }+
fo= r (int j =3D 0; j < ks->send_reliable->size; j++)
= {
if (ks->send_reliable->array[= i].buf.data =3D=3D dataptr)

To view, vi= sit chang= e 426. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I226a73d47a2b1b29f7ec175ce23= a806593abc2ac
Gerrit-Change-Number: 426
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--ONgxSD8WOB0=--