Skip to content

fix(native-sidecar): preserve Python edits to API-seeded files - #2023

Open
ankssjain wants to merge 2 commits into
rivet-dev:mainfrom
ankssjain:fix/python-shadow-write-consistency
Open

ankssjain wants to merge 2 commits into
rivet-dev:mainfrom
ankssjain:fix/python-shadow-write-consistency

Conversation

@ankssjain

Copy link
Copy Markdown

@the-company-company the-company-company 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.

🟠 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).

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python edits to filesystem.writeFile-created files are reverted by shadow reconciliation

1 participant