From yegorslists at googlemail.com Tue Nov 3 00:00:39 2026 From: yegorslists at googlemail.com (Yegor Yefremov) Date: Tue, 3 Nov 2026 06:00:39 +0100 Subject: [File] [PATCH 2/2] seccomp: fix the build with kernel headers older than 5.9 In-Reply-To: <20261103050039.3844049-1-yegorslists@googlemail.com> References: <20261103050039.3844049-1-yegorslists@googlemail.com> Message-ID: <20261103050039.3844049-2-yegorslists@googlemail.com> openat2, faccessat2 and close_range were added in Linux 5.6, 5.8 and 5.9. With older kernel headers, libseccomp maps them to undefined __NR_* macros: seccomp.c:59:52: error: '__NR_openat2' undeclared (first use in this function) Only add the ENOSYS rules when the syscall numbers are defined, like it is already done for other syscalls. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Yegor Yefremov --- src/seccomp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/seccomp.c b/src/seccomp.c index ea27a3a8..376e09b0 100644 --- a/src/seccomp.c +++ b/src/seccomp.c @@ -214,9 +214,15 @@ enable_sandbox(int flags, int action) ALLOW_RULE(writev); /* Newer variants we don't use. ENOSYS lets glibc fall back. */ +#ifdef __NR_openat2 ERRNO_RULE(openat2); +#endif +#ifdef __NR_faccessat2 ERRNO_RULE(faccessat2); +#endif +#ifdef __NR_close_range ERRNO_RULE(close_range); +#endif #if 0 -- 2.34.1 From yegorslists at googlemail.com Tue Nov 3 00:00:38 2026 From: yegorslists at googlemail.com (Yegor Yefremov) Date: Tue, 3 Nov 2026 06:00:38 +0100 Subject: [File] [PATCH 1/2] seccomp: undef pread64 to fix the build with musl Message-ID: <20261103050039.3844049-1-yegorslists@googlemail.com> Since 5.48, seccomp.c includes . With _LARGEFILE64_SOURCE, musl's unistd.h does #define pread64 pread which turns ALLOW_RULE(pread64) into SCMP_SYS(pread), which does not exist: seccomp.c:53:52: error: '__SNR_pread' undeclared (first use in this function) Undefine the macro before using it. The same musl issue affects fstatat64 (bug 473). Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Yegor Yefremov --- src/seccomp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/seccomp.c b/src/seccomp.c index f867abcf..ea27a3a8 100644 --- a/src/seccomp.c +++ b/src/seccomp.c @@ -178,6 +178,7 @@ enable_sandbox(int flags, int action) SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_RDWR, O_RDWR)) == -1) goto out; } +#undef pread64 ALLOW_RULE(pread64); ALLOW_RULE(read); ALLOW_RULE(readlink); -- 2.34.1 From christos at zoulas.com Tue Nov 3 07:55:19 2026 From: christos at zoulas.com (Christos Zoulas) Date: Tue, 3 Nov 2026 07:55:19 -0500 Subject: [File] [PATCH 1/2] seccomp: undef pread64 to fix the build with musl In-Reply-To: <20261103050039.3844049-1-yegorslists@googlemail.com> References: <20261103050039.3844049-1-yegorslists@googlemail.com> Message-ID: <9CA62B9B-5C11-4445-AB87-196295B23F10@zoulas.com> Fixed both, thanks! christos > On Nov 3, 2026, at 12:00?AM, Yegor Yefremov wrote: > > Since 5.48, seccomp.c includes . With _LARGEFILE64_SOURCE, > musl's unistd.h does > > #define pread64 pread > > which turns ALLOW_RULE(pread64) into SCMP_SYS(pread), which does not > exist: > > seccomp.c:53:52: error: '__SNR_pread' undeclared (first use in this function) > > Undefine the macro before using it. The same musl issue affects > fstatat64 (bug 473). > > Assisted-by: Claude:claude-opus-5-5 > Signed-off-by: Yegor Yefremov > --- > src/seccomp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/seccomp.c b/src/seccomp.c > index f867abcf..ea27a3a8 100644 > --- a/src/seccomp.c > +++ b/src/seccomp.c > @@ -178,6 +178,7 @@ enable_sandbox(int flags, int action) > SCMP_CMP(2, SCMP_CMP_MASKED_EQ, O_RDWR, O_RDWR)) == -1) > goto out; > } > +#undef pread64 > ALLOW_RULE(pread64); > ALLOW_RULE(read); > ALLOW_RULE(readlink); > -- > 2.34.1 > > -- > File mailing list > File at astron.com > https://mailman.astron.com/mailman/listinfo/file