Repository navigation
Conversation
There was a problem hiding this comment.
🟠 1 medium-severity finding
Reviewed commit f1e1bac.
🟠 Medium · Mirroring rejects writes to read-only shadow files after the kernel write succeeds
kernel.write_file has already accepted and committed the Python write, but fs::write re-applies the host sidecar user's DAC permissions to the shadow copy. Because the sidecar is intentionally unprivileged, an API-seeded file whose guest mode is 0444/0000 makes this return EACCES; the RPC reports failure after mutating the kernel and leaves stale shadow bytes that reconciliation can restore. Temporarily add owner-write permission to an existing regular shadow file, write it, and restore the guest mode (including on the error path), or use an equivalent sidecar-owned write helper.
Original location: "crates/native-sidecar/src/filesystem.rs":5130 (new side, not submitted inline).
Python and WASM/shell writes go only to the kernel VFS, so the VM root shadow kept the bytes from filesystem.writeFile. The next shadow-to-kernel sync saw the two sides differ and copied the stale shadow over the guest edit, and treated a guest rm/recreate as a host deletion. The shadow sync inventory now records a stamp for both sides at each reconciliation. A shadow change reaches the kernel only when the kernel node is unchanged since then, so every guest writer wins without a per-runtime mirror. Seeded bootstrap content still imports as before. Fixes #2022 and #1901. The Python test helper is adapted from #2023 by ankssjain. Co-authored-by: ankssjain <308424510+ankssjain@users.noreply.github.com>
|
closing this since #2070 fixes it in the shadow sync itself, so shell and wasm writes are covered too. thanks for tracking down the python side, i reused your test setup and credited you in the commit |
fs.statpermission for trusted post-write bookkeeping.c3698e6with a bridge built from that checkout; the existing JavaScript/shell regression used published 0.2.22 WASM command assets. No generated assets or version changes are included.