| Message ID | 20251028162843.18189-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers | show |
| Series | [Openvpn-devel,v4] sitnl: set FD_CLOEXEC on socket to prevent abuse | expand |
Straightforward enough :-)
Your patch has been applied to the master and release/2.6 branch (bugfix).
commit b9b5470521294209146c7253a97012d399978d72 (master)
commit 12a2e88b9e9fc7b0e6f8fce0125b5272980ec51b (release/2.6)
Author: Antonio Quartulli
Date: Tue Oct 28 17:28:38 2025 +0100
sitnl: set FD_CLOEXEC on socket to prevent abuse
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1314
Message-Id: <20251028162843.18189-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33952.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5954a6e..bf754f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -923,6 +923,7 @@ src/openvpn/crypto_openssl.c src/openvpn/crypto.c src/openvpn/crypto_epoch.c + src/openvpn/fdmisc.c src/openvpn/otime.c src/openvpn/packet_id.c ) diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index b3adb16..3e20b70 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -27,6 +27,7 @@ #include "dco.h" #include "errlevel.h" +#include "fdmisc.h" #include "buffer.h" #include "misc.h" #include "networking.h" @@ -181,6 +182,9 @@ return fd; } + /* set close on exec to avoid child processes access the socket */ + set_cloexec(fd); + if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)) < 0) { msg(M_WARN | M_ERRNO, "%s: SO_SNDBUF", __func__); diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index 997703a..0f13172 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -196,6 +196,7 @@ $(top_srcdir)/src/openvpn/crypto_epoch.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \ $(top_srcdir)/src/openvpn/crypto_openssl.c \ + $(top_srcdir)/src/openvpn/fdmisc.c \ $(top_srcdir)/src/openvpn/otime.c \ $(top_srcdir)/src/openvpn/packet_id.c \ $(top_srcdir)/src/openvpn/platform.c