diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index eb572e0ed746ef33ebc52b4a9422b3fd46586e74..0000000000000000000000000000000000000000 --- a/CHANGELOG +++ /dev/null @@ -1,159 +0,0 @@ -CHANGELOG -========= - -version 1.5.1 (released 2025-05-26) - * Added support for SOCKET_WRAPPER_ALLOW_DGRAM_SEQPACKET_FALLBACK - -version 1.5.0 (released 2025-05-06) - * Added support for quic_ko_wrapper - * Fixed pcap frames generation for recv(m)msg and recvfrom - -version 1.4.4 (released 2025-01-21) - * Fixed setsockopt(SO_REUSEPORT) with glibc 2.40 - -version 1.4.3 (released 2024-06-12) - * Fixed socket_wrapper running with jemalloc compiled binaries - * Fixed thread sanitizer on modern Linux Kernels - * Fixed swrap_fake_uid_wrapper test - * Fixed building on Hurd - -version 1.4.2 (released 2023-06-29) - * Fixed LFS issues on 32bit platforms - -version 1.4.1 (released 2023-06-21) - * Fixed issue with fnctl() on 32bit - * Added openat64() to detect stale fds - -version 1.4.0 (released 2023-01-18) - * Added support for sendmmsg()/recvmmsg() - * Added support for handling close, recvmmsg and sendmmsg syscalls - * Added support to interact with uid_wrapper syscall() - * Improved IP address tracing output - -version 1.3.5 (released 2022-11-23) - * Inject O_LARGEFILE as needed on 32bit - * pkgconfig: Fix path to libsocket_wrapper.so - * Fix -Wcast-qual warnings - * Fix dclose(RTLD_NEXT) - -version 1.3.4 (released 2022-07-21) - * Fixed TOCTOU issue with udp auto binding - * Fixed running on FreeBSD - -version 1.3.3 (released 2021-03-17) - * Added public libsocket_wrapper_noop library - * Added wrapper for wrap __close_nocancel() - * Fixed possible deadlock in swrap_pcap_dump_packet() - * Fixed issue when writing pcap files - -version 1.3.2 (released 2021-02-10) - * Fixed possible memory leak between swrap_recvmsg_{before,after}_unix() - -version 1.3.1 (released 2021-02-09) - * Fixed copy on write leak of ~38M for every fork - * Fixed issue with accept() on FreeBSD - * Fixed fd-passing on 32bit platforms - * Fixed invalid read in swrap_sendmsg_unix_scm_rights() - -version 1.3.0 (released 2021-02-03) - * Added support for fd-passing via unix sockets - * Added (de)contructor support on AIX with pragma init/finish - * Fixed mutex fork handling - -version 1.2.5 (released 2020-06-22) - * Added basic support for TCP_INFO and SIOCOUTQ/TIOCOUTQ/FIONWRITE - * Add SOCKET_WRAPPER_DIR_ALLOW_ORIG and abort() early if - SOCKET_WRAPPER_DIR is unusable - -version 1.2.4 (released 2020-03-24) - * Added support for 10.53.57.0 network - * Added _{socket,close,connect,...} symbols on FreeBSD - * Fixed interaction with resolv_wrapper on FreeBSD - -version 1.2.3 (released 2019-03-21) - * Fixed missing NULL check for socket_wrapper_dir() - * Fixes building in Samba source tree - -version 1.2.2 (released 2019-03-21) - * Added environment variable to disable deep binding - * Fixed installation of socket_wrapper - * Fixed several small bugs - -version 1.2.1 (released 2018-11-14) - * Removed error message to fix applications doing stupid things - -version 1.2.0 (released 2018-11-13) - * Added threading support - * Moved to modern cmake - * Several smaller bugfixes - -version 1.1.9 (released 2017-12-04) - * Fixed thread - signal deadlock issue - -version 1.1.8 (released 2017-10-13) - * Added support for openat() - * Added support for open64() and fopen64() - * Always enabled logging support - * Increased maximum for wrapped interfaces to 64 - * Improved fd duplication code - * Fixed strict-aliasing issues - * Fixed some use after free issues - * Fixed issues on ppc64le - -version 1.1.7 (released 2016-05-20) - * Added support for accept4() - * Added support for OpenBSD - * Fixed sendto() with UDP and a connected socket - * Fixed AF_RAWLINK sockets - -version 1.1.6 (released 2016-03-15) - * Added a wrapper for write() - * Added support for automatic binding of ephemeral ports - * Fixed recvmsg() with UDP - * Fixed AF_NETLINK sockets - -version 1.1.5 (released 2015-10-15) - * Added support for TCP_NODELAY in setsockopt/getsockopt - * Fixed cmsg space calculation - -version 1.1.4 (released 2015-08-25) - * Fixed handling of msg_name in recvmsg() - * Fixed sendmsg()/recvmsg() TCP support - * Fixed several compile warnings - * Added environment variable to change MTU - -version 1.1.3 (released 2015-02-23) - * Added support for address sanitizer. - * Fixed leaking of memory and fds of stale sockets. - * Fixed the library loading code. - -version 1.1.2 (released 2014-10-01) - * Added support for fnctl(F_DUPFD). - * Added support for glibc 2.20.90. - -version 1.1.1 (released 2014-06-05) - * Disable incomplete address in use check in bind(). - -version 1.1.0 (released 2014-06-02) - * Added support for IP_PKTINFO in recvmsg(). - * Added support for IPV6_PKTINFO in recvmsg(). - * Added support for IP_RECVDSTADDR in recvmsg() on BSD. - * Added support for more socket options in getsockopt(). - * Added support for bindresvport(). - * Fixed rebinding on connect(). - * Fixed sockaddr buffer truncation in getsockname() and getpeername(). - * Fixed special cases in bind(). - * Fixed loading libc on some platforms. - -version 1.0.2 (released 2014-05-05) - * Fixed memory leaks - * Fixed calling open from libc. - * Fixed loading libc functions on some platforms. - -version 1.0.1 (released 2014-02-04) - * Added --libs to pkg-config. - * Added socket_wrapper-config.cmake - * Fixed a bug packaging the obj directory. - -version 1.0.0 (released 2014-02-02) - * Initial release diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..07ae13235f5c0dc040342af5f8224ca74e7e5d26 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,271 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). + +## [1.5.2] - 2025-12-08 + +### Added +- Improved debugging functionality (see manpage) + +### Fixed +- fd-passing for Python 3.14's ProcessPoolExecutor +- Enhanced debugging for fd types being passed + +## [1.5.1] - 2025-05-26 + +### Added +- Support for SOCKET_WRAPPER_ALLOW_DGRAM_SEQPACKET_FALLBACK + +## [1.5.0] - 2025-05-06 + +### Added +- Support for quic_ko_wrapper + +### Fixed +- pcap frames generation for recv(m)msg and recvfrom + +## [1.4.4] - 2025-01-21 + +### Fixed +- setsockopt(SO_REUSEPORT) with glibc 2.40 + +## [1.4.3] - 2024-06-12 + +### Fixed +- socket_wrapper running with jemalloc compiled binaries +- Thread sanitizer on modern Linux Kernels +- swrap_fake_uid_wrapper test +- Building on Hurd + +## [1.4.2] - 2023-06-29 + +### Fixed +- LFS issues on 32bit platforms + +## [1.4.1] - 2023-06-21 + +### Added +- openat64() to detect stale fds + +### Fixed +- Issue with fnctl() on 32bit + +## [1.4.0] - 2023-01-18 + +### Added +- Support for sendmmsg()/recvmmsg() +- Support for handling close, recvmmsg and sendmmsg syscalls +- Support to interact with uid_wrapper syscall() + +### Changed +- Improved IP address tracing output + +## [1.3.5] - 2022-11-23 + +### Added +- Inject O_LARGEFILE as needed on 32bit + +### Fixed +- pkgconfig: Fix path to libsocket_wrapper.so +- -Wcast-qual warnings +- dclose(RTLD_NEXT) + +## [1.3.4] - 2022-07-21 + +### Fixed +- TOCTOU issue with udp auto binding +- Running on FreeBSD + +## [1.3.3] - 2021-03-17 + +### Added +- Public libsocket_wrapper_noop library +- Wrapper for wrap __close_nocancel() + +### Fixed +- Possible deadlock in swrap_pcap_dump_packet() +- Issue when writing pcap files + +## [1.3.2] - 2021-02-10 + +### Fixed +- Possible memory leak between swrap_recvmsg_{before,after}_unix() + +## [1.3.1] - 2021-02-09 + +### Fixed +- Copy on write leak of ~38M for every fork +- Issue with accept() on FreeBSD +- fd-passing on 32bit platforms +- Invalid read in swrap_sendmsg_unix_scm_rights() + +## [1.3.0] - 2021-02-03 + +### Added +- Support for fd-passing via unix sockets +- (de)contructor support on AIX with pragma init/finish + +### Fixed +- Mutex fork handling + +## [1.2.5] - 2020-06-22 + +### Added +- Basic support for TCP_INFO and SIOCOUTQ/TIOCOUTQ/FIONWRITE +- SOCKET_WRAPPER_DIR_ALLOW_ORIG and abort() early if SOCKET_WRAPPER_DIR is unusable + +## [1.2.4] - 2020-03-24 + +### Added +- Support for 10.53.57.0 network +- _{socket,close,connect,...} symbols on FreeBSD + +### Fixed +- Interaction with resolv_wrapper on FreeBSD + +## [1.2.3] - 2019-03-21 + +### Fixed +- Missing NULL check for socket_wrapper_dir() +- Building in Samba source tree + +## [1.2.2] - 2019-03-21 + +### Added +- Environment variable to disable deep binding + +### Fixed +- Installation of socket_wrapper +- Several small bugs + +## [1.2.1] - 2018-11-14 + +### Removed +- Error message to fix applications doing stupid things + +## [1.2.0] - 2018-11-13 + +### Added +- Threading support + +### Changed +- Moved to modern cmake + +### Fixed +- Several smaller bugfixes + +## [1.1.9] - 2017-12-04 + +### Fixed +- Thread - signal deadlock issue + +## [1.1.8] - 2017-10-13 + +### Added +- Support for openat() +- Support for open64() and fopen64() +- Always enabled logging support + +### Changed +- Increased maximum for wrapped interfaces to 64 +- Improved fd duplication code + +### Fixed +- Strict-aliasing issues +- Some use after free issues +- Issues on ppc64le + +## [1.1.7] - 2016-05-20 + +### Added +- Support for accept4() +- Support for OpenBSD + +### Fixed +- sendto() with UDP and a connected socket +- AF_RAWLINK sockets + +## [1.1.6] - 2016-03-15 + +### Added +- Wrapper for write() +- Support for automatic binding of ephemeral ports + +### Fixed +- recvmsg() with UDP +- AF_NETLINK sockets + +## [1.1.5] - 2015-10-15 + +### Added +- Support for TCP_NODELAY in setsockopt/getsockopt + +### Fixed +- cmsg space calculation + +## [1.1.4] - 2015-08-25 + +### Added +- Environment variable to change MTU + +### Fixed +- Handling of msg_name in recvmsg() +- sendmsg()/recvmsg() TCP support +- Several compile warnings + +## [1.1.3] - 2015-02-23 + +### Added +- Support for address sanitizer + +### Fixed +- Leaking of memory and fds of stale sockets +- Library loading code + +## [1.1.2] - 2014-10-01 + +### Added +- Support for fnctl(F_DUPFD) +- Support for glibc 2.20.90 + +## [1.1.1] - 2014-06-05 + +### Changed +- Disable incomplete address in use check in bind() + +## [1.1.0] - 2014-06-02 + +### Added +- Support for IP_PKTINFO in recvmsg() +- Support for IPV6_PKTINFO in recvmsg() +- Support for IP_RECVDSTADDR in recvmsg() on BSD +- Support for more socket options in getsockopt() +- Support for bindresvport() + +### Fixed +- Rebinding on connect() +- sockaddr buffer truncation in getsockname() and getpeername() +- Special cases in bind() +- Loading libc on some platforms + +## [1.0.2] - 2014-05-05 + +### Fixed +- Memory leaks +- Calling open from libc +- Loading libc functions on some platforms + +## [1.0.1] - 2014-02-04 + +### Added +- --libs to pkg-config +- socket_wrapper-config.cmake + +### Fixed +- Bug packaging the obj directory + +## [1.0.0] - 2014-02-02 + +- Initial release diff --git a/CMakeLists.txt b/CMakeLists.txt index cc3b88f24158dd0aa50e3f8fb6d7c2c3deda2f46..dd280d366482839a7310ac8d0b279519b1f8f66e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") include(DefineCMakeDefaults) include(DefineCompilerFlags) -project(socket_wrapper VERSION 1.5.1 LANGUAGES C) +project(socket_wrapper VERSION 1.5.2 LANGUAGES C) # global needed variables set(APPLICATION_NAME ${PROJECT_NAME}) @@ -24,7 +24,7 @@ set(APPLICATION_NAME ${PROJECT_NAME}) # Increment PATCH. set(LIBRARY_VERSION_MAJOR 0) set(LIBRARY_VERSION_MINOR 5) -set(LIBRARY_VERSION_PATCH 1) +set(LIBRARY_VERSION_PATCH 2) set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") set(LIBRARY_SOVERSION ${LIBRARY_VERSION_MAJOR}) diff --git a/doc/socket_wrapper.1 b/doc/socket_wrapper.1 index c98822790aa3d9ae242f1b7bf585966f4476e455..2b84e231a3e3036d004deaf6e01f8a48a5f56ee3 100644 --- a/doc/socket_wrapper.1 +++ b/doc/socket_wrapper.1 @@ -1,13 +1,13 @@ '\" t .\" Title: socket_wrapper .\" Author: Samba Team -.\" Generator: Asciidoctor 2.0.10 -.\" Date: 2021-02-24 +.\" Generator: Asciidoctor 2.0.20 +.\" Date: 2025-12-08 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "SOCKET_WRAPPER" "1" "2021-02-24" "\ \&" "\ \&" +.TH "SOCKET_WRAPPER" "1" "2025-12-08" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -80,8 +80,8 @@ Ability to capture network traffic in pcap format. . sp -1 . IP \(bu 2.3 .\} -Passing IP sockets (up to 6) via SCM_RIGHTS is supported, -but pcap support only works reliable if the socket is used +Passing IP sockets (up to 16) via SCM_RIGHTS is supported, +but pcap support only works reliably if the socket is used by a single process at a time. .RE .SH "ENVIRONMENT VARIABLES" @@ -97,12 +97,12 @@ socket in the SOCKET_WRAPPER_DIR. .sp \fBSOCKET_WRAPPER_IPV4_NETWORK\fP .RS 4 -By default the loopback IPv4 network "127.0.0.0/8" and the -"127.0.0.x" can be used. In order to make more realistic testing +By default the loopback IPv4 network "127.0.0.0/8" and +"127.0.0.x" addresses can be used. In order to make more realistic testing possible it is possible to use the "10.0.0.0/8" IPv4 network instead. -But note within "10.0.0.0/8" only "10.53.57." can be used, -but the broadcast address is "10.255.255.255". -The following two value are allowed: +Note that within "10.0.0.0/8" only "10.53.57." can be used, +and the broadcast address is "10.255.255.255". +The following two values are allowed: SOCKET_WRAPPER_IPV4_NETWORK="127.0.0.0" (the default) and SOCKET_WRAPPER_IPV4_NETWORK="10.53.57.0". .RE @@ -129,8 +129,8 @@ able to open the file for example with Wireshark. .sp \fBSOCKET_WRAPPER_MTU\fP .RS 4 -With this variable you can change the MTU size. However we do not recomment to -do that as the default size of 1500 byte is best for formatting PCAP files. +With this variable you can change the MTU size. However we do not recommend +doing that as the default size of 1500 bytes is best for formatting PCAP files. .RE .sp The minimum value you can set is 512 and the maximum 32768. @@ -146,8 +146,11 @@ The default value is set to 65535 and the maximum 256000. \fBSOCKET_WRAPPER_DEBUGLEVEL\fP .RS 4 If you need to see what is going on in socket_wrapper itself or try to find a -bug, you can enable logging support in socket_wrapper if you built it with -debug symbols. +bug, you can enable logging support in socket_wrapper. +.RE +.sp +The debug level can be set using either numeric values or string values +(case\-insensitive): .sp .RS 4 .ie n \{\ @@ -157,7 +160,7 @@ debug symbols. . sp -1 . IP \(bu 2.3 .\} -0 = ERROR +0 or "error" = ERROR (default) .RE .sp .RS 4 @@ -168,7 +171,7 @@ debug symbols. . sp -1 . IP \(bu 2.3 .\} -1 = WARNING +1 or "warn"/"warning" = WARNING .RE .sp .RS 4 @@ -179,7 +182,7 @@ debug symbols. . sp -1 . IP \(bu 2.3 .\} -2 = DEBUG +2 or "debug" = DEBUG .RE .sp .RS 4 @@ -190,9 +193,7 @@ debug symbols. . sp -1 . IP \(bu 2.3 .\} -3 = TRACE -.RE -.RE +3 or "trace" = TRACE .sp \fBSOCKET_WRAPPER_DISABLE_DEEPBIND\fP .RS 4 @@ -210,46 +211,57 @@ variable (to any value) allows socket_wrapper to fall back to the original value of SOCKET_WRAPPER_DIR if realpath(3) makes it too long to be usable. .RE +.RE .SH "EXAMPLE" .sp .if n .RS 4 .nf +.fam C # Open a console and create a directory for the unix sockets. $ mktemp \-d /tmp/tmp.bQRELqDrhM +.fam .fi .if n .RE .sp .if n .RS 4 .nf +.fam C # Then start nc to listen for network traffic using the temporary directory. $ LD_PRELOAD=libsocket_wrapper.so \(rs SOCKET_WRAPPER_DIR=/tmp/tmp.bQRELqDrhM \(rs SOCKET_WRAPPER_DEFAULT_IFACE=10 nc \-v \-l 127.0.0.10 7 +.fam .fi .if n .RE .sp .if n .RS 4 .nf +.fam C # (If nc, listens on 0.0.0.0 then listener will be open on 127.0.0.10 because # it is the default interface) +.fam .fi .if n .RE .sp .if n .RS 4 .nf -# Now open another console and start \(aqnc\(aq as a client to connect to the server: +.fam C +# Now open another console and start \*(Aqnc\*(Aq as a client to connect to the server: $ LD_PRELOAD=libsocket_wrapper.so \(rs SOCKET_WRAPPER_DIR=/tmp/tmp.bQRELqDrhM \(rs SOCKET_WRAPPER_DEFAULT_IFACE=100 nc \-v 127.0.0.10 7 +.fam .fi .if n .RE .sp .if n .RS 4 .nf +.fam C # (The client will use the address 127.0.0.100 when connecting to the server) -# Now you can type \(aqHello!\(aq which will be sent to the server and should appear +# Now you can type \*(AqHello!\*(Aq which will be sent to the server and should appear # in the console output of the server. +.fam .fi .if n .RE .SH "PUBLIC FUNCTIONS" @@ -257,9 +269,9 @@ $ LD_PRELOAD=libsocket_wrapper.so \(rs Socket wrapper advanced helpers. .sp Applications with the need to alter their behaviour when -socket wrapper is active, can link use these functions. +socket wrapper is active can use these functions. .sp -By default it\(cqs required for applications to use any of these +By default it\(cqs not required for applications to use any of these functions as libsocket_wrapper.so is injected at runtime via LD_PRELOAD. .sp @@ -306,8 +318,8 @@ an inet socket. . IP \(bu 2.3 .\} socket_wrapper may not be able to intercept the __close_nocancel() -syscall made from within libc.so. As result it\(cqs possible -that the in memory meta date of socket_wrapper references +syscall made from within libc.so. As a result it\(cqs possible +that the in\-memory metadata of socket_wrapper references stale file descriptors, which are already reused for unrelated kernel objects, e.g. files, directories, ... .RE @@ -322,7 +334,7 @@ kernel objects, e.g. files, directories, ... .\} Socket wrapper already intercepts a lot of unrelated functions like eventfd(), timerfd_create(), ... in order -to remove stale meta data for the returned fd, but +to remove stale metadata for the returned fd, but it will never be able to handle all possible syscalls. .RE .sp @@ -348,7 +360,7 @@ be added to libsocket_wrapper.so. . IP \(bu 2.3 .\} This is a no\-op if socket_wrapper is not in use or -if the there is no in memory meta data for the given fd. +if there is no in\-memory metadata for the given fd. .RE .SH "RESOURCES" .sp diff --git a/doc/socket_wrapper.1.adoc b/doc/socket_wrapper.1.adoc index 39c46eee8aaf5b482356dfeee12c8b723aaa972a..a1e27bc6f8bfbc16ce9740cc4adc2ce5299c1ea9 100644 --- a/doc/socket_wrapper.1.adoc +++ b/doc/socket_wrapper.1.adoc @@ -1,6 +1,6 @@ socket_wrapper(1) ================= -:revdate: 2021-02-01 +:revdate: 2025-12-08 :author: Samba Team :doctype: manpage @@ -25,8 +25,8 @@ testing of complex network configurations. - Redirects all network communication to happen over Unix sockets. - Support for IPv4 and IPv6 socket and addressing emulation. - Ability to capture network traffic in pcap format. -- Passing IP sockets (up to 6) via SCM_RIGHTS is supported, - but pcap support only works reliable if the socket is used +- Passing IP sockets (up to 16) via SCM_RIGHTS is supported, + but pcap support only works reliably if the socket is used by a single process at a time. ENVIRONMENT VARIABLES @@ -42,12 +42,12 @@ socket in the SOCKET_WRAPPER_DIR. *SOCKET_WRAPPER_IPV4_NETWORK*:: -By default the loopback IPv4 network "127.0.0.0/8" and the -"127.0.0.x" can be used. In order to make more realistic testing +By default the loopback IPv4 network "127.0.0.0/8" and +"127.0.0.x" addresses can be used. In order to make more realistic testing possible it is possible to use the "10.0.0.0/8" IPv4 network instead. -But note within "10.0.0.0/8" only "10.53.57." can be used, -but the broadcast address is "10.255.255.255". -The following two value are allowed: +Note that within "10.0.0.0/8" only "10.53.57." can be used, +and the broadcast address is "10.255.255.255". +The following two values are allowed: SOCKET_WRAPPER_IPV4_NETWORK="127.0.0.0" (the default) and SOCKET_WRAPPER_IPV4_NETWORK="10.53.57.0". @@ -71,8 +71,8 @@ able to open the file for example with Wireshark. *SOCKET_WRAPPER_MTU*:: -With this variable you can change the MTU size. However we do not recomment to -do that as the default size of 1500 byte is best for formatting PCAP files. +With this variable you can change the MTU size. However we do not recommend +doing that as the default size of 1500 bytes is best for formatting PCAP files. The minimum value you can set is 512 and the maximum 32768. @@ -86,13 +86,15 @@ The default value is set to 65535 and the maximum 256000. *SOCKET_WRAPPER_DEBUGLEVEL*:: If you need to see what is going on in socket_wrapper itself or try to find a -bug, you can enable logging support in socket_wrapper if you built it with -debug symbols. +bug, you can enable logging support in socket_wrapper. -- 0 = ERROR -- 1 = WARNING -- 2 = DEBUG -- 3 = TRACE +The debug level can be set using either numeric values or string values +(case-insensitive): + +- 0 or "error" = ERROR (default) +- 1 or "warn"/"warning" = WARNING +- 2 or "debug" = DEBUG +- 3 or "trace" = TRACE *SOCKET_WRAPPER_DISABLE_DEEPBIND*:: @@ -139,9 +141,9 @@ PUBLIC FUNCTIONS Socket wrapper advanced helpers. Applications with the need to alter their behaviour when -socket wrapper is active, can link use these functions. +socket wrapper is active can use these functions. -By default it's required for applications to use any of these +By default it's not required for applications to use any of these functions as libsocket_wrapper.so is injected at runtime via LD_PRELOAD. @@ -163,14 +165,14 @@ void socket_wrapper_indicate_no_inet_fd(int fd); an inet socket. - socket_wrapper may not be able to intercept the __close_nocancel() - syscall made from within libc.so. As result it's possible - that the in memory meta date of socket_wrapper references + syscall made from within libc.so. As a result it's possible + that the in-memory metadata of socket_wrapper references stale file descriptors, which are already reused for unrelated kernel objects, e.g. files, directories, ... - Socket wrapper already intercepts a lot of unrelated functions like eventfd(), timerfd_create(), ... in order - to remove stale meta data for the returned fd, but + to remove stale metadata for the returned fd, but it will never be able to handle all possible syscalls. - socket_wrapper_indicate_no_inet_fd() gives applications a way @@ -178,7 +180,7 @@ void socket_wrapper_indicate_no_inet_fd(int fd); be added to libsocket_wrapper.so. - This is a no-op if socket_wrapper is not in use or - if the there is no in memory meta data for the given fd. + if there is no in-memory metadata for the given fd. RESOURCES