mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-02-03 20:39:40 -05:00
tunnel_server_*(): close correct inotify fd
Some checks failed
Build / gcc-mingw - mingw (push) Has been cancelled
Build / gcc-mingw - mingw64 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --disable-lzo --disable-lz4 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --disable-management (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --enable-async-push (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --enable-iproute2 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --enable-small (push) Has been cancelled
Build / gcc - ubuntu-18.04 - OpenSSL 1.0.2 (push) Has been cancelled
Build / gcc - ubuntu-18.04 - OpenSSL 1.1.1 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 (push) Has been cancelled
Build / gcc - ubuntu-22.04 - OpenSSL 3.0.2 (push) Has been cancelled
Build / gcc - ubuntu-18.04 - mbed TLS (push) Has been cancelled
Build / gcc - ubuntu-20.04 - mbed TLS (push) Has been cancelled
Build / gcc - ubuntu-22.04 - mbed TLS (push) Has been cancelled
Build / clang-asan - ubuntu-20.04 - mbedtls (push) Has been cancelled
Build / clang-asan - ubuntu-20.04 - openssl (push) Has been cancelled
Build / macOS - OpenSSL 1.1 - asan (push) Has been cancelled
Build / macOS - OpenSSL 3 - asan (push) Has been cancelled
Build / macOS - OpenSSL 1.1 - normal (push) Has been cancelled
Build / macOS - OpenSSL 3 - normal (push) Has been cancelled
Build / msbuild - arm64 - openssl (push) Has been cancelled
Build / msbuild - x86 - openssl (push) Has been cancelled
Build / msbuild - x64 - openssl (push) Has been cancelled
Some checks failed
Build / gcc-mingw - mingw (push) Has been cancelled
Build / gcc-mingw - mingw64 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --disable-lzo --disable-lz4 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --disable-management (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --enable-async-push (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --enable-iproute2 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 --enable-small (push) Has been cancelled
Build / gcc - ubuntu-18.04 - OpenSSL 1.0.2 (push) Has been cancelled
Build / gcc - ubuntu-18.04 - OpenSSL 1.1.1 (push) Has been cancelled
Build / gcc - ubuntu-20.04 - OpenSSL 1.1.1 (push) Has been cancelled
Build / gcc - ubuntu-22.04 - OpenSSL 3.0.2 (push) Has been cancelled
Build / gcc - ubuntu-18.04 - mbed TLS (push) Has been cancelled
Build / gcc - ubuntu-20.04 - mbed TLS (push) Has been cancelled
Build / gcc - ubuntu-22.04 - mbed TLS (push) Has been cancelled
Build / clang-asan - ubuntu-20.04 - mbedtls (push) Has been cancelled
Build / clang-asan - ubuntu-20.04 - openssl (push) Has been cancelled
Build / macOS - OpenSSL 1.1 - asan (push) Has been cancelled
Build / macOS - OpenSSL 3 - asan (push) Has been cancelled
Build / macOS - OpenSSL 1.1 - normal (push) Has been cancelled
Build / macOS - OpenSSL 3 - normal (push) Has been cancelled
Build / msbuild - arm64 - openssl (push) Has been cancelled
Build / msbuild - x86 - openssl (push) Has been cancelled
Build / msbuild - x64 - openssl (push) Has been cancelled
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 5521872f80 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
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>
(cherry picked from commit 172fe07129)
This commit is contained in:
parent
193b76ef6e
commit
477775b032
2 changed files with 6 additions and 2 deletions
|
|
@ -845,7 +845,9 @@ tunnel_server_tcp(struct context *top)
|
|||
}
|
||||
|
||||
#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 */
|
||||
|
|
|
|||
|
|
@ -361,7 +361,9 @@ tunnel_server_udp_single_threaded(struct context *top)
|
|||
}
|
||||
|
||||
#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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue