| Message ID | 20260128150640.13867-1-gert@greenie.muc.de |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:8da0:b0:80a:3855:ce6a with SMTP id iy32csp60604mab;
Wed, 28 Jan 2026 07:06:55 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AJvYcCUB6DsTASQR6pYkRgK27DfxQQV4f2cQqy6OdIUeJyF3npwOdxg6SV/+g3GY7Nackd/0arA8Dpc/y0k=@openvpn.net
X-Received: by 2002:a05:6808:1b25:b0:45e:dbda:add6 with SMTP id
5614622812f47-45efc70bd2amr3654716b6e.57.1769612814979;
Wed, 28 Jan 2026 07:06:54 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1769612814; cv=none;
d=google.com; s=arc-20240605;
b=f3ewwcvUg5wXE9q9aeHL7V9cfbQZqy1b/2eY2t98ivQlSmwfBByApgphqp/4bSFaES
Rl1NEeDLPTGpGrQ+zDf3pc9B1b4WfKperHSLYksZlMa8q/pml3lpz9h3TPq4Z+OnS4fD
O3tnZdHIUyI2SW+2C9lxuthzWZVu6GWmDX97zhiAgyvupkcfw29stVM+bWBpy6gCXMYR
B5rAtPee9GHiv7R3OgZX/OHac+mQCpJvBvN7Ijft692AiDZ/rLiD3ZRAO6j38lBpVAXW
IPChu0RZ3TQV/slqtZ6zsC4/q7MdO5i1I7qAniZe34OjtKoiVWhcIpQFtRUZEydIDkA2
fIvQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:references:in-reply-to:message-id:date:to:from
:dkim-signature:dkim-signature:dkim-signature;
bh=PrW25Z077nRAE3ISOjrlzT/brAyWeZMI6y45PFFAuU4=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=SHHuhCqTnVBbPvj41X5rUWXDWpNf4fWGyPRLdntMSe+Rx7MbeDqHPy86SWZBYu0Ioz
rr87EP2aU0ZS5gbYUgxWqtdQ1f6vdujKl5I5WT1NEdqxkCWC6cW6I/Oa0uM3VfPqTWMb
skkr2XQng14iuCrJDRwgNgi6daX8HrwOHLQmvEzuGLY34Ptm6ACgLrJJ1ZiXorFaxx1J
35oyQJ2q0bn5jVSzgkgoTDtg6qSA8BnWe9/kg6Gl7qmOPX8rxZdCq/4XfAosOVCPR4lP
G1jK8ghi4yF29jMTMWvNYZXonujLxeRbkL7+ajt7SLmjTT6uBFkw2vsBb1XNJXkXobAZ
r7ng==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=cP7lZTk5;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=VKEVC2kL;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=Qm0RM5mp;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
5614622812f47-45f08d8a018si1574126b6e.27.2026.01.28.07.06.54
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 28 Jan 2026 07:06:54 -0800 (PST)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=cP7lZTk5;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=VKEVC2kL;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=Qm0RM5mp;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender:
Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;
bh=PrW25Z077nRAE3ISOjrlzT/brAyWeZMI6y45PFFAuU4=; b=cP7lZTk5ByHdZYKnwjssFksK86
eUU2jHvDgXiFK86uN6Y70vRqN+ExIrKznSVqz1rBKjSKbky99+5N0xIPddD1f0m5vnc+6ehXgyzAu
HtXRfdD8IlDstJAW9ytFpKn0T3GF/GWZjmcOfc2PpEpPCmCoDtFstdKzcONysVzh9Zv4=;
Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com)
by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1vl786-0004jA-M2;
Wed, 28 Jan 2026 15:06:50 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <gert@blue4.greenie.muc.de>) id 1vl785-0004j4-59
for openvpn-devel@lists.sourceforge.net;
Wed, 28 Jan 2026 15:06:49 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References:
In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:
Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=Erja7QGrnPMNkGMbCz8ypvTCMZ/orKSJMaALdtowimU=; b=VKEVC2kL10ImigWfDNpFNdjQKS
vw7JzSjzAUc/S0ZBISZP1NF/G9/AmY3F9KnU27Klfgimv7t2TEobfA1ZTegGjnRpAdLTyCfjzB73O
Igu2yIkRhR8G+VaCRc+xBMHib+qGJiUcuKE+JlMeBbrA1wlajSu5cnQTJ8lFf4Y8FGSg=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:
Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
List-Post:List-Owner:List-Archive;
bh=Erja7QGrnPMNkGMbCz8ypvTCMZ/orKSJMaALdtowimU=; b=Qm0RM5mpYeP0xRvBHEnWr9Nul6
V2JCi8mL+dc0YNiCXacyy8sRKbVhcOBw/O1t58PqfgRzmVORy2sqVogbqa4/GYU766d/xF45gklcf
UaxM+9hdIQX1BnGXY+6ypQaUFZG0+CTgU8swsrhgUJGATgd7z6QG1obKaYICSEANaBhc=;
Received: from [193.149.48.134] (helo=blue.greenie.muc.de)
by sfi-mx-2.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1vl784-0008Dp-0z for openvpn-devel@lists.sourceforge.net;
Wed, 28 Jan 2026 15:06:49 +0000
Received: from blue.greenie.muc.de (localhost [127.0.0.1])
by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 60SF6eLq013890
for <openvpn-devel@lists.sourceforge.net>; Wed, 28 Jan 2026 16:06:40 +0100
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 60SF6ehe013889
for openvpn-devel@lists.sourceforge.net; Wed, 28 Jan 2026 16:06:40 +0100
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 28 Jan 2026 16:06:35 +0100
Message-ID: <20260128150640.13867-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.51.2
In-Reply-To:
<gerrit.1769611655000.Idcb1421b9f7fcbee9620fd1d45cceab050751373@gerrit.openvpn.net>
References:
<gerrit.1769611655000.Idcb1421b9f7fcbee9620fd1d45cceab050751373@gerrit.openvpn.net>
MIME-Version: 1.0
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-2.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: On a full SIGUSR1 restart of a p2mp server compiled with
--enable-async-push,
tunnel_server_{udp,tcp}() will try to close and reopen the "inotify" control
file descriptor. For whatever reason, the ori [...]
Content analysis details: (1.3 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Headers-End: 1vl784-0008Dp-0z
Subject: [Openvpn-devel] [PATCH v1] tunnel_server_*(): close correct inotify
fd
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1855573527344455046?=
X-GMAIL-MSGID: =?utf-8?q?1855573527344455046?=
|
| Series |
[Openvpn-devel,v1] tunnel_server_*(): close correct inotify fd
|
|
Commit Message
Gert Doering
Jan. 28, 2026, 3:06 p.m. UTC
On a full SIGUSR1 restart of a p2mp server compiled with
--enable-async-push, tunnel_server_{udp,tcp}() will try to close and
reopen the "inotify" control file descriptor. For whatever reason,
the original code referenced the wrong context, always closing fd 0.
As a consequence of this, on the second SIGUSR1 restart, the server
will close() the first active socket file descriptor, and if there
are active DCO clients, the resulting event confusion will lead to
an ASSERT(!mi->halt).
Fix by closing the correct FD. Add logging.
This is a backport of commit 5521872f80313060 to the "old p2mp code"
with a separate mudp.c and mtcp.c for UDP and TCP servers, respectively.
Github: fixes OpenVPN/openvpn#966
Change-Id: Idcb1421b9f7fcbee9620fd1d45cceab050751373
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1499
---
This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to release/2.6.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1499
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Arne Schwabe <arne-openvpn@rfc2549.org>
Comments
As it says on the lid, this is a backport of the master commit to multi.c,
to the "until 2.6" source files for separate UDP and TCP servers, mudp.c
and mtcp.c. Verified with "run server, look at lsof -P -p $pid, send
SIGUSR1, look at lsof again" (and see the FD 0 now change roles).
..
openvpn 4513 root 0u IPv4 61650705 0t0 UDP *:31194
openvpn 4513 root 5r a_inode 0,12 0 2066 inotify
openvpn 4513 root 6r a_inode 0,12 0 2066 inotify
..
Patch has been applied to the release/2.6 and release/2.5 branches.
(It would apply and bugfix release/2.4 as well, but this is *so* out
of maintenance that I did do this. 2.3.x does not have inotify
support yet)
commit 172fe07129f02be2d3e6779c632ed1e8081c412c (release/2.6)
commit 477775b032c2c47322d1453bdfff11b607fbac91 (release/2.5)
Author: Gert Doering
Date: Wed Jan 28 16:06:35 2026 +0100
tunnel_server_*(): close correct inotify fd
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1499
Message-Id: <20260128150640.13867-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35493.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/mtcp.c b/src/openvpn/mtcp.c index 96408d1..3e33b15 100644 --- a/src/openvpn/mtcp.c +++ b/src/openvpn/mtcp.c @@ -850,7 +850,9 @@ } #ifdef ENABLE_ASYNC_PUSH - close(top->c2.inotify_fd); + msg(D_LOW, "%s: close multi.top.c2.inotify_fd (%d)", + __func__, multi.top.c2.inotify_fd); + close(multi.top.c2.inotify_fd); #endif /* shut down management interface */ diff --git a/src/openvpn/mudp.c b/src/openvpn/mudp.c index 0492311..f7c9ffd 100644 --- a/src/openvpn/mudp.c +++ b/src/openvpn/mudp.c @@ -524,7 +524,9 @@ } #ifdef ENABLE_ASYNC_PUSH - close(top->c2.inotify_fd); + msg(D_LOW, "%s: close multi.top.c2.inotify_fd (%d)", + __func__, multi.top.c2.inotify_fd); + close(multi.top.c2.inotify_fd); #endif /* shut down management interface */