[Tor Gitlab #40020 - maint-0.3.5]: Fix seccomp sandbox rules for opening directories#2013
Open
Jigsaw52 wants to merge 3 commits intotorproject:maint-0.3.5from
Open
[Tor Gitlab #40020 - maint-0.3.5]: Fix seccomp sandbox rules for opening directories#2013Jigsaw52 wants to merge 3 commits intotorproject:maint-0.3.5from
Jigsaw52 wants to merge 3 commits intotorproject:maint-0.3.5from
Conversation
The need for casting negative syscall arguments depends on the glibc version. This affects the rules for the openat syscall which uses the constant AT_FDCWD that is defined as a negative number. This commit adds logic to only apply the cast when necessary, on glibc versions from 2.27 onwards.
Different versions of glibc use either open or openat for the opendir function. This commit adds logic to use the correct rule for each glibc version, namely: - Until 2.14 open is used - From 2.15 to to 2.21 openat is used - From 2.22 to 2.26 open is used - From 2.27 onwards openat is used
Pull Request Test Coverage Report for Build 9701
💛 - Coveralls |
Fix crash introduced in #40020. On startup, tor calls check_private_dir on the data and key directories. This function uses open instead of opendir on the received directory. Data and key directoryes are only opened here, so the seccomp rule added should be for open instead of opendir, despite the fact that they are directories.
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.
Different versions of glibc use either open or openat for the
opendir function. This commit adds logic to use the correct rule
for each glibc version, namely: