fix(blaze): accept nsfs mount roots - #2730
Open
WeissonHan wants to merge 1 commit into
Open
Conversation
Linux reports persistent network namespace bind mounts with an opaque `net:[inode]` root in mountinfo. Treating every root as a host pathname prevents daemon startup whenever such a namespace already exists. Read the filesystem type after the mountinfo separator and admit a single opaque root component only for nsfs. Normalize that identifier into the mount table's internal key while retaining absolute-path requirements for all mount points and other filesystem roots. This keeps template boundary alias checks fail closed for ordinary filesystems and lets restart validation coexist with named namespaces. Fixes: 181f931 ("feat(blaze): implement template catalog") Signed-off-by: Weisson <Weisson@linux.alibaba.com>
Collaborator
Author
|
@codex review This PR accepts Linux nsfs namespace roots without weakening ordinary filesystem path validation. |
Collaborator
Author
|
@qoder review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
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.
Description
Linux represents a persistent network namespace bind mount with an
nsfsmountinfo root such as
net:[4026539640]. Blaze treated every mount root as ahost pathname, so template boundary validation rejected that valid record and
prevented
blazedfrom starting or restarting while a named network namespaceexisted.
This change reads the filesystem type from the mountinfo record and accepts a
non-absolute root only when it is one opaque component on
nsfs. The namespaceidentifier is normalized into the mount table's internal comparison key.
Mount points remain absolute for every filesystem, and roots remain absolute
for every non-
nsfsfilesystem.Before: one valid
nsfsrecord could reject the complete mount table and abortdaemon startup.
After: named network namespaces coexist with startup boundary validation,
without weakening the ordinary filesystem path checks used to reject unsafe
template storage aliases.
This is an internal parser correction. It changes no HTTP API, configuration,
persisted format, or user-facing design contract, so no product documentation
is changed.
Related Issue
closes #2729
Type of Change
Scope
cosh(copilot-shell)cosh-ng(cosh-ng)sec-core(agent-sec-core)skill(os-skills)sight(agentsight)tokenless(tokenless)ckpt(ws-ckpt)memory(agent-memory)anolisa(anolisa-cli)skillfs(SkillFS)blaze(blaze)Checklist
cosh: Lint passes, type check passes, and tests passcosh-ng:cargo clippy --all-targets -- -D warningsandcargo fmt --checkpasssec-core(Rust):cargo clippy -- -D warningsandcargo fmt --checkpasssec-core(Python): Ruff format and pytest passskill: Skill directory structure is valid and shell scripts pass syntax checksight:cargo clippy -- -D warningsandcargo fmt --checkpasstokenless:cargo clippy -- -D warningsandcargo fmt --checkpassmemory(Linux only):cargo clippy --all-targets --locked -- -D warnings,cargo fmt --check, andcargo testpassanolisa:cargo clippy --all-targets --locked -- -D warnings,cargo fmt --all --check, andcargo test --lockedpassskillfs:cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspacepasspackage-lock.json/Cargo.lock)Testing
Validated commit
3fc9d7f824f211694a2d744c3ad489c1ee7a7a2bon Linux x86_64 with the repository-pinned Rust 1.88.0 toolchain:cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— 69blaze-coreand 345blazedtests passedcargo doc --workspace --no-depsFocused coverage includes the exact
nsfsmountinfo field layout emitted for anamed network namespace and a regression assertion that a relative
ext4rootis still rejected.
Additional Notes