Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230227223822.GH4163@brightrain.aerifal.cx>
Date: Mon, 27 Feb 2023 17:38:23 -0500
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] accept4: don't fall back to accept if we got
 unknown flags

On Mon, Feb 27, 2023 at 10:46:54PM +0300, Alexey Izbyshev wrote:
> 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 propagating the syscall attempt failure if unknown flags are
> present.
> 
> The behavior is still not ideal on old kernels lacking accept4 on arches
> with socketcall, where failing with ENOSYS instead of EINVAL returned by
> socketcall would be preferable, but at least modern kernels are now
> fine.

Can you clarify what you mean about ENOSYS vs EINVAL here? I'm not
following.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.