foxcpp / foxcpp/scmp-confine

Implement post-exec filter loading

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Like firejail does, avoids the need to include a number of Go runtime calls (futex, rt_sigmask, nanosleep, epoll_wait) and execve into all filters.

Possible implementation:
1. Compile a separate "loader" DSO
2. Use memfd_create and write BPF code into FD.
3. Set LD_PRELOAD to inject "loader" DSO.
4. Exec target binary, passing filter FD to it (specify the FD number via env. var).
5. Have "loader" DSO load filter and unset FD number env. var on load.

This obviously will not work with statically linked executables, but most executables are dynamically linked with at least libc so it can be ignored.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.