From: "cron2 (Code Review)" Date: Sun, 10 Sep 2023 15:33:25 +0000 In-Reply-To: References: Reply-To: openvpn-devel@lists.sourceforge.net, frank@...2641..., a@...2181... Message-ID: <63e53945cdd2f8e7ecb27c2ef4227ff04ff697c1-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Z2f9LtxREMU="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco: fix crash when --multihome is used with --proto tcp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: flichtenheld , openvpn-devel --Z2f9LtxREMU= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/32= 4?usp=3Demail ) Change subject: dco: fix crash when --multihome is used with --proto tcp ...................................................................... dco: fix crash when --multihome is used with --proto tcp Although it's a combination of options that is not really useful, when specifying --multihome along with --proto tcp and DCO is enabled, OpenVPN will crash while attempting to access c2.link_socket_actual (NULL for the TCP case) in order to retrieve the local address (in function dco_multi_get_localaddr()) Prevent crash by running this code only if proto is UDP. The same check is already performed in socket.c/h for the non-DCO case. Github: fixes OpenVPN/openvpn#390 Change-Id: I61adc26ce2ff737e020c3d980902a46758cb23e5 Signed-off-by: Antonio Quartulli Acked-by: Gert Doering Message-Id: <20230815231555.6465-1-a@...2181...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26= 953.html Signed-off-by: Gert Doering --- M src/openvpn/dco.c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 7c7eaac..cd3e0ad 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -509,7 +509,7 @@ #if ENABLE_IP_PKTINFO struct context *c =3D &mi->context; - if (!(c->options.sockflags & SF_USE_IP_PKTINFO)) + if (!proto_is_udp(c->c2.link_socket->info.proto) || !(c->options.sockf= lags & SF_USE_IP_PKTINFO)) { return false; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/324?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: I61adc26ce2ff737e020c3d980902a46758cb23e5 Gerrit-Change-Number: 324 Gerrit-PatchSet: 2 Gerrit-Owner: ordex Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --Z2f9LtxREMU= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

dco: fix crash when --multihome is used with -=
-proto tcp

Although it's a combination of options that is not re= ally useful,
when specifying --multihome along with --proto tcp and DCO = is enabled,
OpenVPN will crash while attempting to access c2.link_socket= _actual
(NULL for the TCP case) in order to retrieve the local address (= in
function dco_multi_get_localaddr())

Prevent crash by running t= his code only if proto is UDP.
The same check is already performed in so= cket.c/h for the non-DCO
case.

Github: fixes OpenVPN/openvpn#390<= br>Change-Id: I61adc26ce2ff737e020c3d980902a46758cb23e5
Signed-off-by: A= ntonio Quartulli <a@...2181...>
Acked-by: Gert Doering <gert@...1186...= .1296...>
Message-Id: <20230815231555.6465-1-a@...2181...>
U= RL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg269= 53.html
Signed-off-by: Gert Doering <gert@...1296...>
---
M = src/openvpn/dco.c
1 file changed, 1 insertion(+), 1 deletion(-)

<= /pre>
diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c
index= 7c7eaac..cd3e0ad 100644
--- a/src/openvpn/dco.c
= +++ b/src/openvpn/dco.c
@@ -509,7 +509,7 @@ #if ENABLE_IP_PKTINFO
struct context *c =3D &a= mp;mi->context;

- if (!(c->options.sockflags & SF_USE_IP_PKTINFO))<= /span>
+ if (!proto_is_ud= p(c->c2.link_socket->info.proto) || !(c->options.sockflags & S= F_USE_IP_PKTINFO))
{
return f= alse;
}

To view, v= isit chan= ge 324. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I61adc26ce2ff737e020c3d98090= 2a46758cb23e5
Gerrit-Change-Number: 324
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <a@...2181...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--Z2f9LtxREMU=--