From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23795 invoked from network); 19 Jun 2023 18:28:22 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 19 Jun 2023 18:28:22 -0000 Received: (qmail 5871 invoked by uid 550); 19 Jun 2023 18:28:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 23742 invoked from network); 19 Jun 2023 18:15:05 -0000 X-Gm-Message-State: AC+VfDxivujU/WI443eOngPCrwOrbLRLoylQCkiNmV4+Koxx1Da4mc6y UGP+hlQJoJQKHIDgnak8jFCpGUNJiNbd2JvajK4= X-Google-Smtp-Source: ACHHUZ7KwhDEIUapADG3ZjqUM7nicDXNElbHLjzTCLVxpJ4YvoPtlxuhfgHFFC+hTQxHYsn14jc1vGHw7Ckd7FJfs58= X-Received: by 2002:a5b:ccb:0:b0:ba8:373d:821a with SMTP id e11-20020a5b0ccb000000b00ba8373d821amr7366015ybr.23.1687198490368; Mon, 19 Jun 2023 11:14:50 -0700 (PDT) MIME-Version: 1.0 From: Mike Gilbert Date: Mon, 19 Jun 2023 14:14:39 -0400 X-Gmail-Original-Message-ID: Message-ID: To: musl@lists.openwall.com Cc: "Michael Gilbert (floppym)" Content-Type: text/plain; charset="UTF-8" Subject: [musl] 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