Skip to content

Conversation

@Yin-SHT
Copy link

@Yin-SHT Yin-SHT commented Aug 31, 2025

Description

This PR fixes a compatibility issue with the seccomp filter that causes the program to crash on systems running glibc 2.33 or newer.

Problem

The current seccomp filter only allows the fstat syscall for printf operations. However, modern glibc versions (2.33+) have switched to using newfstatat instead of fstat for checking file descriptor properties during stdio operations.

When printf is called on newer systems, it triggers newfstatat, which is not in the allowed syscall list, causing the process to be killed.

Solution

Added SYS_newfstatat to the seccomp filter's allowed syscall list:

BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SYS_newfstatat, 0, 1),
BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant