Repository navigation
fix(hyperrs-fs): tear down any jail tree a hostile VMM can build - #167
Merged
Merged
Conversation
A FIFO opened as a regular file or device blocked before the type check ran, so FileLock::acquire ignored its timeout with a FIFO at the lock name. A refused O_TRUNC open still truncated and a refused O_CREAT open left a new file. Probe with O_PATH, validate, then reopen with the real flags; create only with O_EXCL, and only for types a create can yield.
The jail root is owned by the jail uid, so Firecracker can create any name in it. entries() rejected every name that was not a StrictComponent (whitespace included) with EINVAL, and rmdirat_recursive held one fd per level, so a name like 'a b' or a tree deeper than RLIMIT_NOFILE made JailLayout::remove fail on every retry and leaked the jail. entries() now yields a LooseComponent (no '/', NUL, '.' or '..'), and rmdirat_recursive walks iteratively holding no fd per level, climbing through '..' only when it is the recorded parent inode.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Test Results 4 files ± 0 261 suites +20 3m 23s ⏱️ +13s Results for commit 5fe1e3f. ± Comparison against base commit e2764c3. This pull request removes 2 and adds 71 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
…ecks Pin close-on-exec on every open route, that a directory id is stable across paths and distinct between directories, and that a NUL byte is refused in strict and loose components. Exclude the equivalent | -> ^ open-flag mutants, whose operands never share a bit.
check_component took an allow_whitespace bool and returned (), so every caller validated and then cast through new_unchecked. Each component type now owns a const from_bytes returning &Self, and StrictComponent refines a parsed ComponentWithWhitespace. Structural errors now win over whitespace: " a/b" is Separator, not Whitespace.
markovejnovic
marked this pull request as ready for review
November 16, 2026 02:45
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.
No description provided.