rust-vmm / seccompiler

Provides easy-to-use Linux seccomp-bpf jailing.
https://crates.io/crates/seccompiler
Apache License 2.0
70 stars 10 forks source link

Remove libc runtime dependency #64

Closed Kijewski closed 10 months ago

Kijewski commented 10 months ago

Summary of the PR

With this PR the library has no runtime dependencies except rust's global allocator. This could mean an ever so slightly security increase, because raw syscalls are not subject to LD_PRELOAD.

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

alindima commented 10 months ago

Thanks for the recent contributions.

I am not sure this brings any improvement. First of all, it uses an external dependency that is quite new and unused (compared to libc at the very least). I'd much rather depend on the C standard library and the rust libc wrapper. The libc wrapper should also be very thin and just delegate to inline assembly for making the syscall. Secondly, almost every application depends on libc already (unless you're trying to use it in a [no_std] environment?).

The apply_filter function of the library is quite a thin wrapper over a couple of syscalls. If the consumer of the library has a more opinionated way of installing the filters, it's quite easy to do this in the application code.