about summary refs log tree commit diff
path: root/src/unistd/close.c
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2023-02-28 03:11:17 +0300
committerRich Felker <dalias@aerifal.cx>2023-02-28 11:48:05 -0500
commitc499c1084eaccd83e4b6e60883a5d92df0202c5e (patch)
tree60d31455d5424a07c8bde0c41001c6b2865c0616 /src/unistd/close.c
parent523d9b965df65bd3ad52863abc817724d7a35f32 (diff)
downloadmusl-c499c1084eaccd83e4b6e60883a5d92df0202c5e.tar.gz
musl-c499c1084eaccd83e4b6e60883a5d92df0202c5e.tar.xz
musl-c499c1084eaccd83e4b6e60883a5d92df0202c5e.zip
accept4: don't fall back to accept if we got unknown flags
accept4 emulation via accept ignores unknown flags, so it can spuriously
succeed instead of failing (or succeed without doing the action implied
by an unknown flag if it's added in a future kernel). Worse, unknown
flags trigger the fallback code even on modern kernels if the real
accept4 syscall returns EINVAL, because this is indistinguishable from
socketcall returning EINVAL due to lack of accept4 support.

Fix this by always failing with EINVAL if unknown flags are present and
the syscall is missing or failed with EINVAL.
Diffstat (limited to 'src/unistd/close.c')
0 files changed, 0 insertions, 0 deletions