From: "cron2 (Code Review)" Date: Wed, 22 Apr 2026 07:04:59 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, ralf@...2726... Message-ID: <2ddecfe4811f592fc229523e11ff954ee2d7931d-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="TOb65ISqMD8="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: dco-linux: enforce ifindex only for DEL_PEER notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ralf_lici , plaisthos Cc: openvpn-devel --TOb65ISqMD8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= ralf_lici. ( http://gerrit.openvpn.net/c/openvpn/+/1636?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: dco-linux: enforce ifindex only for DEL_PEER notifications ...................................................................... dco-linux: enforce ifindex only for DEL_PEER notifications The unconditional ifindex check introduced by commit e78a8af2f5ce rejects legitimate kernel replies, specifically peer stats responses, because those messages do not carry OVPN_ATTR_IFINDEX. Move the check into ovpn_handle_del_peer() so it applies only to spontaneous DEL_PEER notifications from the kernel. This keeps response handling working while still filtering foreign-instance notifications. Fixes: e78a8af2f5ce ("dco: backport immediate notification processing on Li= nux and FreeBSD") Github: closes OpenVPN/openvpn#1020 Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660 Signed-off-by: Ralf Lici Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1636 Message-Id: <20260422055636.20691-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36= 721.html Signed-off-by: Gert Doering --- M src/openvpn/dco_linux.c 1 file changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/36/1636/2 diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 8ce7026..1df56cf 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -857,6 +857,23 @@ static int ovpn_handle_del_peer(dco_context_t *dco, struct nlattr *attrs[]) { + /* we must know which interface this message is referring to in order = to + * avoid mixing messages for other instances + */ + if (!attrs[OVPN_ATTR_IFINDEX]) + { + msg(D_DCO, "ovpn-dco: Received message without ifindex"); + return NL_STOP; + } + + uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]); + if (ifindex !=3D dco->ifindex) + { + msg(D_DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifindex %= d", + ifindex); + return NL_SKIP; + } + if (!attrs[OVPN_ATTR_DEL_PEER]) { msg(D_DCO, "ovpn-dco: no attributes in OVPN_DEL_PEER message"); @@ -930,23 +947,6 @@ return NL_STOP; } - /* we must know which interface this message is referring to in order = to - * avoid mixing messages for other instances - */ - if (!attrs[OVPN_ATTR_IFINDEX]) - { - msg(D_DCO, "ovpn-dco: Received message without ifindex"); - return NL_STOP; - } - - uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDEX]); - if (ifindex !=3D dco->ifindex) - { - msg(D_DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifindex %= d", - ifindex); - return NL_SKIP; - } - /* based on the message type, we parse the subobject contained in the * message, that stores the type-specific attributes. * -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1636?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660 Gerrit-Change-Number: 1636 Gerrit-PatchSet: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --TOb65ISqMD8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by ralf_lici.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 by cron2

dco-linux: enforce ifindex only for=
 DEL_PEER notifications

The unconditional ifindex check introduced b= y commit e78a8af2f5ce
rejects legitimate kernel replies, specifically pe= er stats responses,
because those messages do not carry OVPN_ATTR_IFINDE= X.

Move the check into ovpn_handle_del_peer() so it applies only to<= br>spontaneous DEL_PEER notifications from the kernel. This keeps
respon= se handling working while still filtering foreign-instance
notifications= .

Fixes: e78a8af2f5ce ("dco: backport immediate notification pr= ocessing on Linux and FreeBSD")
Github: closes OpenVPN/openvpn#1020=
Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea2f92191669660
Signed-off-by: = Ralf Lici <ralf@...2726...>
Acked-by: Gert Doering <gert@...1826...= 6...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1636
Mess= age-Id: <20260422055636.20691-1-gert@...1296...>
URL: https://www.= mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36721.html
Signe= d-off-by: Gert Doering <gert@...1296...>
---
M src/openvpn/dco_= linux.c
1 file changed, 17 insertions(+), 17 deletions(-)

<= pre class=3D"blocks" style=3D"font-family: monospace,monospace; white-space= : pre-wrap;">git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/3= 6/1636/2
diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_lin=
ux.c
index 8ce7026..1df56cf 100644
--- a/sr= c/openvpn/dco_linux.c
+++ b/src/openvpn/dco_linux.c<= br>@@ -857,6 +857,23 @@
static int
= ovpn_handle_del_peer(dco_context_t *dco, struct nlattr *attrs[])
= {
+ /* we m= ust know which interface this message is referring to in order to+ * avoid mixing messages = for other instances
+= */
+ if (!att= rs[OVPN_ATTR_IFINDEX])
+ msg= (D_DCO, "ovpn-dco: Received message without ifindex");
= + return NL_STOP;=
+ }
+
+ uint32_t ifindex =3D nla_get_u32(attrs[OVPN_ATTR_IFINDE= X]);
+ if (ifindex= !=3D dco->ifindex)
+ msg= (D_DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifindex %d"= ,
+ ifinde= x);
+ return N= L_SKIP;
+ }=
+
if (= !attrs[OVPN_ATTR_DEL_PEER])
{
= msg(D_DCO, "ovpn-dco: no attributes in OVPN_DEL_PEER message");<= /span>
@@ -930,23 +947,6 @@
return NL_STO= P;
}

- /* we must know which interface this message is r= eferring to in order to
- * avoid mixing messages for other instances
- */
- if (!attrs[OVPN_ATTR_IFINDEX])
- {
- msg(D_DCO, "ovpn-dco: Received message without ifi= ndex");
- r= eturn NL_STOP;
- }
-
- uint32_t ifindex =3D nla_get_u32(attrs[= OVPN_ATTR_IFINDEX]);
- = if (ifindex !=3D dco->ifindex)
- {
- = msg(D_DCO_DEBUG, "ovpn-dco: ignoring message for foreign ifinde= x %d",
- = ifindex);
- re= turn NL_SKIP;
- }
-
/*= based on the message type, we parse the subobject contained in the<= br> * message, that stores the type-specific attributes.<= br> *

To view, visit change 1636= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I9b1f4fd06c8a02d3f51b6a3bdea= 2f92191669660
Gerrit-Change-Number: 1636
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --TOb65ISqMD8=--