Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sandbox: deny newfstatat used by newer glibc.
The Linux system call 'newfstatat' provides a single interface that can be used to implement stat(), lstat(), fstat(), or fstatat(). stat(), lstat(), and fstat() are safe to use in the sandbox. LightWAVE doesn't use these functions directly, but other libraries may use fstat() internally. The general fstatat() is not safe for the same reasons that openat() is not safe. Unfortunately, the system call interface doesn't allow seccomp to permit fstat-equivalent newfstatat without permitting the more general and dangerous fstatat-equivalent. Recent versions of glibc now use newfstatat, instead of fstat, to implement fstat(), as well as calling newfstatat whenever a stdio stream is used for the first time. We can't avoid these calls (short of patching glibc, or using the signal handler to emulate the system call.) Fortunately, glibc will still work if the call fails (it might be a tiny bit less efficient.)
- Loading branch information