Repository navigation
Conversation
With the feature, the vDSO function pointers are statics in their own section, .rustix_vdso. They start null, init writes each at most once (compare-exchange) from the vDSO named by AT_SYSINFO_EHDR, and the system-call fallback is called directly instead of being stored. A static analysis of the binary can then prove every target of the vDSO calls. Without the feature nothing changes.
Member
|
This adds a fair amount of complexity to an already complex piece of code. As an alternative, could users that need to avoid rustix's vDSO code use the |
Author
|
No. We have no C library. Our libc is c-scape on rustix's linux_raw backend (our fork of Eyra). We need one writer of the vDSO pointers. Heimdall derives a state machine of the allowed system calls from a graph of the Rust program, so it must know every target of an indirect call. If the table is too much, a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the feature, the vDSO function pointers live in one table, the
.rustix_vdsosection.They start null,
initwrites each at most once (compare-exchange) from the vDSO thatAT_SYSINFO_EHDRnames, and nothing else writes them; without a vDSO entry thesystem-call fallback is called directly instead of stored. Without the feature nothing changes.
Why: a syscall filter made statically from the binary has to prove every target of an
indirect call, and that needs one provable writer of the vDSO pointers.
We use it in Heimdall, a dynamic per-thread syscall filter: a state machine generated from
a graph of the program (https://www.gunnar.rs/nordisk/heimdall).