Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/devices/src/virtio/fs/linux/passthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,18 @@ impl FileSystem for PassthroughFs {
self.announce_submounts.store(true, Ordering::Relaxed);
}

// Enable POSIX ACL support when the kernel is capable and xattrs are enabled.
// For a passthrough filesystem, the host kernel handles ACL semantics —
// we just forward the system.posix_acl_* xattrs.
// ALLOW_IDMAP requires POSIX_ACL on Linux 6.12+ (see containers/libkrun#568).
if self.cfg.xattr && capable.contains(FsOptions::POSIX_ACL) {
opts |= FsOptions::POSIX_ACL;

if capable.contains(FsOptions::ALLOW_IDMAP) {
opts |= FsOptions::ALLOW_IDMAP;
}
}

Ok(opts)
}

Expand Down
12 changes: 12 additions & 0 deletions src/devices/src/virtio/fs/macos/passthrough.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,18 @@ impl FileSystem for PassthroughFs {
self.announce_submounts.store(true, Ordering::Relaxed);
}

// Enable POSIX ACL support when the kernel is capable and xattrs are enabled.
// For a passthrough filesystem, the host kernel handles ACL semantics —
// we just forward the system.posix_acl_* xattrs.
// ALLOW_IDMAP requires POSIX_ACL on Linux 6.12+ (see containers/libkrun#568).
if self.cfg.xattr && capable.contains(FsOptions::POSIX_ACL) {
opts |= FsOptions::POSIX_ACL;

if capable.contains(FsOptions::ALLOW_IDMAP) {
opts |= FsOptions::ALLOW_IDMAP;
}
}

Ok(opts)
}

Expand Down
3 changes: 1 addition & 2 deletions src/devices/src/virtio/fs/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,7 @@ impl<F: FileSystem + Sync> Server<F> {
| FsOptions::MAX_PAGES
| FsOptions::SUBMOUNTS
| FsOptions::HANDLE_KILLPRIV_V2
| FsOptions::INIT_EXT
| FsOptions::ALLOW_IDMAP;
| FsOptions::INIT_EXT;

if cfg!(target_os = "macos") {
supported |= FsOptions::SECURITY_CTX;
Expand Down
Loading