Skip to content

fix(blaze): accept nsfs mount roots - #2730

Open
WeissonHan wants to merge 1 commit into
alibaba:mainfrom
WeissonHan:fix/blaze/nsfs-mountinfo-root
Open

fix(blaze): accept nsfs mount roots#2730
WeissonHan wants to merge 1 commit into
alibaba:mainfrom
WeissonHan:fix/blaze/nsfs-mountinfo-root

Conversation

@WeissonHan

Copy link
Copy Markdown
Collaborator

Description

Linux represents a persistent network namespace bind mount with an nsfs
mountinfo root such as net:[4026539640]. Blaze treated every mount root as a
host pathname, so template boundary validation rejected that valid record and
prevented blazed from starting or restarting while a named network namespace
existed.

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 namespace
identifier is normalized into the mount table's internal comparison key.
Mount points remain absolute for every filesystem, and roots remain absolute
for every non-nsfs filesystem.

Before: one valid nsfs record could reject the complete mount table and abort
daemon 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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional change)
  • Performance improvement
  • CI/CD or build changes

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)
  • Multiple / Project-wide

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly
  • For cosh: Lint passes, type check passes, and tests pass
  • For cosh-ng: cargo clippy --all-targets -- -D warnings and cargo fmt --check pass
  • For sec-core (Rust): cargo clippy -- -D warnings and cargo fmt --check pass
  • For sec-core (Python): Ruff format and pytest pass
  • For skill: Skill directory structure is valid and shell scripts pass syntax check
  • For sight: cargo clippy -- -D warnings and cargo fmt --check pass
  • For tokenless: cargo clippy -- -D warnings and cargo fmt --check pass
  • For memory (Linux only): cargo clippy --all-targets --locked -- -D warnings, cargo fmt --check, and cargo test pass
  • For anolisa: cargo clippy --all-targets --locked -- -D warnings, cargo fmt --all --check, and cargo test --locked pass
  • For skillfs: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace pass
  • Lock files are up to date (package-lock.json / Cargo.lock)

Testing

Validated commit 3fc9d7f824f211694a2d744c3ad489c1ee7a7a2b on Linux x86_64 with the repository-pinned Rust 1.88.0 toolchain:

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — 69 blaze-core and 345 blazed tests passed
  • cargo doc --workspace --no-deps

Focused coverage includes the exact nsfs mountinfo field layout emitted for a
named network namespace and a regression assertion that a relative ext4 root
is still rejected.

Additional Notes

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>
@WeissonHan
WeissonHan requested a review from casparant as a code owner August 20, 2026 12:12
@github-actions github-actions Bot added the component:blaze src/blaze label Aug 20, 2026
@WeissonHan

Copy link
Copy Markdown
Collaborator Author

@codex review This PR accepts Linux nsfs namespace roots without weakening ordinary filesystem path validation.

@WeissonHan

Copy link
Copy Markdown
Collaborator Author

@qoder review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 3fc9d7f824

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@qoderai qoderai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本次审查范围内未发现需要修改的问题。


🤖 Generated by QoderView workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(blaze): accept nsfs mount roots

1 participant