#953
virtio/fs: add confined macOS path resolution
Implement a descriptor-based backend for restricted macOS virtio-fs
access using LinuxSimplified ownership and permissions. Keep guest
requests within the exported directory instead of resolving inodes
through global /.vol paths.
Pin the root and tracked inodes with owned file descriptors. Recheck
ancestry and identity before inode and handle operations, including
reads, writes and metadata updates. Deny further access when an object
is moved outside, unlinked or overwritten, while allowing handle
cleanup.
Never let the host kernel dereference guest symlinks. Expand link text
manually when target access is needed, resolving relative targets from
the containing directory and absolute targets from the export root.
Reject traversal above the root and limit expansion to 40 links.
Reject hard-link creation, non-directory objects with multiple links,
special files and cross-device traversal. Validate request names as
single components, check both sides of renames, and verify opened
descriptors before truncating or changing file contents.
Use direct I/O and zero entry and attribute cache lifetimes. Leave
xattrs, security contexts, idmaps, writeback caching and DAX
unsupported. Keep the backend test-only here; expose the personality
separately.
These checks assume a stable host namespace: concurrent host renames,
replacements or hard-link creation can race validation and use. Stronger
guarantees require additional host OS isolation.
Test manual link resolution, stale inodes and handles, namespace
changes, hard-link rejection and attempts to escape the export.Activity
5This pull request is a draft
Merging is unavailable until it is marked ready for review.
I'm testing this using a modified virtio-fs kernel module in the guest: https://github.com/slp/linux/tree/virtio-fs-adversarial-tests