From: "cron2 (Code Review)" Date: Mon, 29 Dec 2025 16:12:50 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., antonio@...2726... Message-ID: <9db7c4c89e05511722347d47a337cfbbf29a6045-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Pgu/XEYATYs="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[release/2.6]: multi: Warn about failing read in multi_process_file_closed() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --Pgu/XEYATYs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello ordex, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1444?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+2 by ordex Change subject: multi: Warn about failing read in multi_process_file_closed= () ...................................................................... multi: Warn about failing read in multi_process_file_closed() Handle failure explicitly instead of the implicit handling by "while (buffer_i < r)". Backport of 18d1b1fe008a4bbfd5a56ca7bb59f6f8cb58114a and the relevant type fix of 5e5ead5ba019fc2a8266f77a7d840b30fd545198 Reported-by: Marc Heuse Github: openvpn-private-issues#101 Change-Id: I950863eeba67b8c006c794245a1a08752cd79fb0 Signed-off-by: Gert Doering Acked-by: Antonio Quartulli Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1444 Message-Id: <20251216111544.27133-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 113.html Signed-off-by: Gert Doering --- M src/openvpn/multi.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/1444/2 diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 94e623b..69497a6 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2830,8 +2830,13 @@ multi_process_file_closed(struct multi_context *m, const unsigned int mpp_= flags) { char buffer[INOTIFY_EVENT_BUFFER_SIZE]; - size_t buffer_i =3D 0; - int r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_BUFFER_SIZE= ); + ssize_t buffer_i =3D 0; + ssize_t r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_EVENT_BUFFER_= SIZE); + if (r < 0) + { + msg(M_WARN | M_ERRNO, "MULTI: multi_process_file_closed error"); + return; + } while (buffer_i < r) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1444?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: I950863eeba67b8c006c794245a1a08752cd79fb0 Gerrit-Change-Number: 1444 Gerrit-PatchSet: 2 Gerrit-Owner: cron2 Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: flichtenheld Gerrit-CC: openvpn-devel --Pgu/XEYATYs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to this change.

View Change

The followi= ng approvals got outdated and were removed: Code-Review+2 by ordex

multi: Warn about failing read in m=
ulti_process_file_closed()

Handle failure explicitly instead of the = implicit
handling by "while (buffer_i < r)".

Backpor= t of 18d1b1fe008a4bbfd5a56ca7bb59f6f8cb58114a and the relevant
type fix = of 5e5ead5ba019fc2a8266f77a7d840b30fd545198

Reported-by: Marc Heuse = <marc@...2953...>
Github: openvpn-private-issues#101
Change-Id:= I950863eeba67b8c006c794245a1a08752cd79fb0
Signed-off-by: Gert Doering &= lt;gert@...1296...>
Acked-by: Antonio Quartulli <antonio@...2804...= .>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1444
Message= -Id: <20251216111544.27133-1-gert@...1296...>
URL: https://www.mai= l-archive.com/openvpn-devel@lists.sourceforge.net/msg35113.html
Signed-o= ff-by: Gert Doering <gert@...1296...>
---
M src/openvpn/multi.c=
1 file changed, 7 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/1444/2<=
/pre>
-    size_t buffer_i =3D 0;
- int r =3D read(m->top.c2.inotify_fd, buffer, INOTI= FY_EVENT_BUFFER_SIZE);
+ ssize_t r =3D read(m->top.c2.inotify_fd, buffer, INOTIFY_= EVENT_BUFFER_SIZE);
+= if (r < 0)
+ = {
+ msg(M_WA= RN | M_ERRNO, "MULTI: multi_process_file_closed error");+ return;
+ }
while (buffer_i < r)
{

To view, visit change 1444. To unsubscribe, or for help wr= iting mail filters, visit settings.

=
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I950863eeba67b8c006c794245a1= a08752cd79fb0
Gerrit-Change-Number: 1444
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: flichtenheld <frank@...2641...&g= t;
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --Pgu/XEYATYs=--