fix: validate and confine service mount paths - #3655
Conversation
e6f9eb4 to
c9b202c
Compare
|
Thanks — for the record, the approval at HEAD c9b202c covers the final tree (the restructure push predates it). Build matrix is still running; leaving the merge to you once it's green. |
c9b202c to
7aa66a5
Compare
|
Heads-up on the new head (7aa66a5): the test job failed on the approved head with a linker error ( Delta since the approval: that test is dropped, nothing else changed. The remaining unit tests cover the path handling itself, and the exact committed tree was re-verified with the CI command in the same container ( |
Resolve the paths handed to the host-side mount effect and verify the result stays under its base directory (the target volume for the source, the caller's rootfs for the mountpoint). util::io::canonicalize, which tolerates a not-yet-existing tail, now folds parent-dir components in that tail lexically instead of re-appending them verbatim, so the returned path always matches what the kernel resolves. Also limit the internal bind-mount helper to the local start-container CLI, where container-runtime invokes it, instead of registering it on the shared effects handler.
7aa66a5 to
0228066
Compare
Summary
util::io::canonicalize, which tolerates a not-yet-existing tail, now folds parent-dir components in that tail lexically instead of re-appending them verbatim, so the returned path always matches what the kernel resolves.bind-mounthelper on the localstart-containerCLI only, which is how container-runtime invokes it.Test plan
cargo test -p start-core --features=test --lib— all pass, including in the pinned build container with the CI command (--release --features=test,dev,unstable)make start-core-format(pinned nightly) and prettier both clean