Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ0EP43QiTHZMsmLFrE5qFCgyq+FE7QSk=povbPT-VjF=FEusA@mail.gmail.com>
Date: Mon, 19 Jun 2023 14:14:39 -0400
From: Mike Gilbert <floppym@...too.org>
To: musl@...ts.openwall.com
Cc: "Michael Gilbert (floppym)" <floppym@...too.org>
Subject: faccessat behavior on old kernels (<5.8)

I am not subscribed, so please CC me on replies.

I received a bug report on Gentoo Linux.

https://bugs.gentoo.org/908765

There appears to be a difference in behavior between musl and glibc
when running on Linux kernels that lack support for the faccessat2
system call.

On glibc, the following call returns 0. On musl, it returns -1 and
sets errno to EINVAL.

faccessat(AT_FDCWD, "/dev/null", F_OK, AT_SYMLINK_NOFOLLOW);

On older kernels, the underlying faccessat2 syscall returns -1 / ENOSYS.
glibc follows that up with an fstatat64 with equivalent arguments.
musl immediately fails with -1 / EINVAL.

Relevant code:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/faccessat.c;h=0ccbd778b5f4d61f9121b6aeb59782c21ae647a0;hb=a704fd9a133bfb10510e18702f48a6a9c88dbbd5#l36

https://git.musl-libc.org/cgit/musl/tree/src/unistd/faccessat.c?h=v1.2.4#n34

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.