jasonwhite / jasonwhite/syscalls
Add predefined sets of syscalls
- Dominant language
- Rust
- Stars
- 141
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
With `SysnoSet`, we can create a bitset of syscalls at compile time. Having predefined sets for various groups of related syscalls is useful for constructing seccomp filters. strace for example, categorizes syscalls in their syscall tables.
We could have `SysnoSet`s for:
- [ ] All syscalls that create file descriptors.
- [ ] All syscalls that take file descriptors as parameters.
- [ ] All network related syscalls.
- [ ] All memory related syscalls.
- [ ] All state-related syscalls.
- [ ] All signal-related syscalls.
- [ ] All syscalls that never fail (e.g., `getpid`, `gettid`).
- [ ] All process-related syscalls.
The great thing about using a bitset for these is that they can be easily manipulated with set operations (e.g., union, intersection, difference).
These syscall sets should probably be behind a feature flag to avoid slowing down compilation for crates that only need basic functionality.
---
See also:
* strace's x86_64 syscall table: https://github.com/strace/strace/blob/2c591a8976529fb1c5951d7d54dee2d0ace5b206/src/linux/x86_64/syscallent.h
* strace's shorthand notation used in the table above: https://github.com/strace/strace/blob/df89e8bb642dbe63b3a6f82bb571d1b1139d1439/src/sysent_shorthand_defs.h#L38-L61
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating `SysnoSet` and the syscall definitions in the crate. Use the linked strace syscall tables and shorthand definitions to classify the proposed groups, then determine how a feature flag should expose them. Done means the requested predefined sets are available and can be combined with set operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100