From: "cron2 (Code Review)" Date: Sat, 2 Dec 2023 15:56:35 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="eG2ZueTu3GI="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix check_session_buf_not_used using wrong index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --eG2ZueTu3GI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/45= 9?usp=3Demail ) Change subject: Fix check_session_buf_not_used using wrong index ...................................................................... Fix check_session_buf_not_used using wrong index The inner loop used i instead of j when iterating through the buffers. Since i is always between 0 and 2 and ks->send_reliable->size is (when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) this does not cause an index of out bounds. So while the check was not doing anything really useful with i instead of j, at least it was not crashing or anything similar. Noticed-By: Jon Williams (braindead-bf) on Github issue #449 Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Message-Id: <20231128104359.62967-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 576.html Signed-off-by: Gert Doering --- M src/openvpn/ssl.c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index 400230c..b5d24b5 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -3207,7 +3207,7 @@ for (int j =3D 0; j < ks->send_reliable->size; j++) { - if (ks->send_reliable->array[i].buf.data =3D=3D dataptr) + if (ks->send_reliable->array[j].buf.data =3D=3D dataptr) { msg(M_INFO, "Warning buffer of freed TLS session is still = in" " use (session->key[%d].send_reliable->array[%d])", -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/459?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: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5d Gerrit-Change-Number: 459 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --eG2ZueTu3GI= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Fix check_session_buf_not_used using wrong ind=
ex

The inner loop used i instead of j when iterating through the buf= fers.

Since i is always between 0 and 2 and ks->send_reliable->= ;size is
(when it is defined) always 6 (TLS_RELIABLE_N_SEND_BUFFERS) thi= s does not
cause an index of out bounds. So while the check was not doi= ng anything
really useful with i instead of j, at least it was not crash= ing or
anything similar.

Noticed-By: Jon Williams (braindead-bf) = on Github issue #449
Change-Id: Ia3d5b4946138df322ebcd9e9e77d04328dacbc5= d
Signed-off-by: Arne Schwabe <arne@...1227...>
Acked-by: Frank= Lichtenheld <frank@...2641...>
Message-Id: <20231128104359.629= 67-1-frank@...2641...>
URL: https://www.mail-archive.com/openvpn-deve= l@lists.sourceforge.net/msg27576.html
Signed-off-by: Gert Doering <ge= rt@...1296...>
---
M src/openvpn/ssl.c
1 file changed, 1 insert= ion(+), 1 deletion(-)

diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c
index= 400230c..b5d24b5 100644
--- a/src/openvpn/ssl.c
= +++ b/src/openvpn/ssl.c
@@ -3207,7 +3207,7 @@<= br>
for (int j =3D 0; j < ks->send_re= liable->size; j++)
{
- if (ks->send_reliable->array[i= ].buf.data =3D=3D dataptr)
+ if (ks->send_reliable->array[j].buf.data =3D=3D da= taptr)
{
msg(= M_INFO, "Warning buffer of freed TLS session is still in"<= br> " use (session->key[%d].send_reliable= ->array[%d])",

To view, visit <= a href=3D"http://gerrit.openvpn.net/c/openvpn/+/459?usp=3Demail">change 459= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia3d5b4946138df322ebcd9e9e77= d04328dacbc5d
Gerrit-Change-Number: 459
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--eG2ZueTu3GI=--