Repository navigation
Conversation
validate_filesystem_paths only treated POSIX "/" (and repeated "/") as the filesystem root, so read_write entries such as "C:/", "C:\", "\", "\\?\C:\" or "\\server\share" passed validation on a Windows gateway and reached the MXC driver as a whole-drive grant. Detect roots lexically and independently of the gateway host OS: POSIX roots, drive roots, the current-drive root, verbatim/device drive roots and UNC share roots, ignoring repeated separators and "." components. The shared validator covers sandbox create, live policy updates and the supervisor's OPA data check. Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
|
All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO document and I hereby sign the DCO. |
|
recheck |
shailendra-nv
left a comment
There was a problem hiding this comment.
The shared-validator change fixes the reported C:/ case, but two equivalent-root cases still pass the new validation; details are inline. Focused native ARM64 tests using the verbatim PR validator/helper pass the three new policy tests and fail two additional regression tests for these cases. This was extracted-code validation and native path-resolution testing; the full PR build and gateway E2E were not rerun, and no successful workload root write is claimed.
shailendra-nv
left a comment
There was a problem hiding this comment.
Requesting changes for the two remaining root-path validation gaps described in the existing inline comments:
- Windows namespace/separator aliases still pass validation: #5303 (comment)
- Win32 trailing-dot/space root aliases still pass validation: #5303 (comment)
Please close these gaps and add regression coverage before merging. The PR remains at the reviewed commit, 37ea092. Native ARM64 extracted-code tests confirmed both findings; full PR builds and gateway E2E were not rerun.
is_filesystem_root only recognised the namespace prefix when the original path started with two backslashes, so "//?/C:/", "/\?\C:\" and the NT spelling "\??\C:\" passed validation. It also treated only empty and "." components as naming the root, so "C:/...", "C:/ " and "C:/. " passed even though Win32 drops trailing dots and spaces from a component. The MXC driver converts "/" to "\" and resolves each of these paths to the drive root. Match the "\\?\", "\\.\" and "\??\" prefixes after separator normalization, and treat two leading separators as a UNC prefix when either is a backslash, so a POSIX "//tmp/x" keeps its meaning. When deciding whether a path names a root, ignore trailing dots and spaces in its components, as Win32 does; this includes paths with a leading "/", which the MXC driver reads as the root of the current drive. Verbatim and NT paths keep their components as written, so "\\?\C:\..." remains a narrower path. Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
|
Pushed 926cc6a for both review threads.
Not changed: |
shailendra-nv
left a comment
There was a problem hiding this comment.
Requesting changes: the current revision still accepts a GLOBALROOT device path that names a whole drive. The actionable finding and reproduction evidence are inline.
Reviewed commit: 926cc6a7f49de649f3be30b3378b1a57950d3996 against windows. The separator/namespace and trailing-dot/space cases raised previously are covered by this revision. All four added policy tests passed in an isolated native Windows ARM64 harness using the exact validator/helper; the additional GLOBALROOT rejection regression failed with Ok(()). Full crate/server tests and MXC end-to-end enforcement were not rerun.
Separately, linked issue #5302 lacks state:accepted, and the PR author's verified repository permission is read, so the target branch's issue-acceptance requirement remains unmet.
is_filesystem_root took the first name after "\\?\", "\\.\" or "\??\" as the volume, so "\\?\GLOBALROOT\Device\HarddiskVolume4\" was read as the directory "Device\HarddiskVolume4" on a volume called GLOBALROOT and passed validation. GLOBALROOT links to the root of the NT object namespace, so the path names the whole volume, and the MXC driver accepts grants in that namespace. Read the name after the prefix as an entry of the "\??" directory: "UNC" and drive letters as before, "Global" as a link back to the same directory, and "GLOBALROOT" as the object namespace root. Below that root, "\??", "\GLOBAL??" and "\DosDevices" hold the same names, and a "\Device" path names a volume after the device name, after "HarddiskN\PartitionM" for a disk, or after the server and share for a network redirector. Any other object path is treated as a root, because a link elsewhere in the namespace can name a whole volume. Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
|
Pushed d644341 for the GLOBALROOT review.
|
shailendra-nv
left a comment
There was a problem hiding this comment.
Re-reviewed d6443414ac2b35644c9307bfa0bc5c984f263fc1. The previously reported GLOBALROOT root alias is now rejected, including all three native namespace spellings. All five added policy tests plus the native-resolution regression passed in the isolated Windows ARM64 harness.
Requesting changes for one new regression: unbounded namespace recursion still runs on paths already marked too long, causing a reproducible stack-overflow abort in unoptimized development/test builds. The inline comment contains the before/after evidence and the optimized-build limitation.
The condition for proceeding to /windows-ci, approval, and merge has not been met because this actionable finding remains. No full crate/server tests or MXC end-to-end tests were run in this re-review.
Signed-off-by: Shailendra Singh <shailendras@nvidia.com>
|
/windows-ci |
|
/ok to test 41f9399 |
|
Label |
Compatibility review (advisory)Unaddressed breaking changes The candidate rejects valid narrower Windows namespace paths, not only filesystem roots. This breaks existing policy files on a non-breaking train. 1. policy — ACKEDA Windows
Review details
Advisory review; publication gates are unchanged. |
|
Bot-comment follow-up for e84cefb:
The separate maintainer-approval requirement also remains pending. All existing inline review threads are resolved, but the remaining compatibility advisory above has deliberately not been marked resolved. |
Windows ARM64 CI: ⌛ runningCommit |
Signed-off-by: Shailendra Singh <shailendras@nvidia.com>
|
/windows-ci |
|
/ok to test e84cefb |
Compatibility review (advisory)Unaddressed breaking changes Existing policies using unrecognized Windows object-namespace aliases in 1. policy — ACKEDAbsolute
Review details
Advisory review; publication gates are unchanged. |
Apply the VM runtime hashes and K3s installer pin already merged into windows in NVIDIA#5736. The runtime hashes match the published release asset digests. Signed-off-by: Shailendra Singh <shailendras@nvidia.com>
|
/windows-ci |
|
/ok to test e3739ef |
|
E2E diagnosed and repaired in new commit e3739ef: the previous head's macOS VM build failed because its pinned runtime archive hash was stale. The VM runtime and K3s installer files now exactly match the already-merged Windows repair in #5736 (f0db2ee); the three runtime hashes also match GitHub's release-asset digests. No checksum validation was disabled. Fresh CI has been requested for this head. The policy code remains identical to e84cefb (308 native ARM64 tests and scoped Clippy passed). The remaining compatibility advisory for unknown object aliases stays open, with the root protection retained as requested. |
Compatibility review (advisory)Unaddressed breaking changes Stable policy validation now rejects previously accepted Windows object-namespace read-write paths, including aliases that may target narrower directories. Migration is documented and the risk is acknowledged, but this train does not allow breaks. 1. policy — ACKEDUnknown Windows
Review details
Advisory review; publication gates are unchanged. |
Summary
Reject filesystem roots as read-write grants across POSIX and Windows path spellings. Namespace validation uses constant stack space and skips paths already rejected for exceeding the byte-length limit.
Related Issue
Closes #5302
Changes
GLOBALROOT/SystemRootWindows-directory alias. Unknown object-namespace aliases remain conservatively rejected because they may name an entire volume.windowsvia fix(ci): repair Windows VM runtime and K3s installer pins #5736. The files exactly match that repair, and the VM hashes match published release-asset digests.The existing host-dependent absolute-path check is outside this change.
Compatibility review remains open for conservative rejection of unknown object aliases. The maintainer explicitly chose to retain this protection; documentation and acknowledgement do not remove the current train's compatibility restriction.
Testing
Latest revision:
e3739ef7372c5c0c630bd1c972b3d351835c1d6b. The final commit changes CI pins only; the policy code tested locally is unchanged from e84cefb.cargo test --locked -p openshell-policy— 308 passed in the unoptimized test profile.git diff --check.\\?\,\\.\, and\??\GLOBALROOT/SystemRoot spellings resolve to the Windows directory, narrower than the drive root, on the test host.The full local
mise run --skip-tools --jobs 1 pre-committask was attempted but did not complete: the TypeScript Biome formatter crashes on this Windows ARM64 host with exit0xC0000005. Earlier Python tooling setup also required an x64 interpreter. This is not reported as a passing full pre-commit run.The author previously verified Windows x64 gateway/MXC sandbox creation and live policy updates on earlier revisions, including root rejection and narrower-path acceptance. Those manual MXC scenarios have not been rerun locally on the latest revision.
Checklist