Skip to content

actiondfs: use mount credentials for Landlock-safe backing opens - #44

Open
zbarsky-openai wants to merge 1 commit into
hermeticbuild:mainfrom
zbarsky-openai:zbarsky/actiondfs-landlock-backing-credentials
Open

zbarsky-openai wants to merge 1 commit into
hermeticbuild:mainfrom
zbarsky-openai:zbarsky/actiondfs-landlock-backing-credentials

Conversation

@zbarsky-openai

Copy link
Copy Markdown

Landlock-confined programs cannot read files from actiondfs even when their policy
explicitly grants the visible actiondfs path:

PermissionError: [Errno 13] Permission denied:
'/execroot/.../python3.12/encodings/__init__.py'

The visible path is authorized, but actiondfs then opens its hidden ext4 CAS or
staging backing file with the already-confined task credentials. Landlock
evaluates that unrelated underlying path and rejects the internal open.

Follow Linux overlayfs's existing model: retain the mount creator's credentials,
temporarily override task credentials only while opening internal directory,
CAS, and staged backing files, then restore the caller immediately. The original
VFS/Landlock check still applies to the user-visible actiondfs path. Release the
saved credential when the superblock is destroyed.

Validated by rebuilding and booting the actual ARM64 guest kernel through
actiond (f16f4f3f-df24-4954-8a61-793858c17bc7, 943 real remote actions), then
rerunning both production sandbox seccomp cases with a real Landlock policy
(08b932ab-9f76-4129-a0bb-3bba52793ea6). The complete sandbox suite advanced
to 178 passing tests; remaining failures are independent guest capability gaps.

Landlock-confined programs cannot read files from actiondfs even when their policy
explicitly grants the visible actiondfs path:

```text
PermissionError: [Errno 13] Permission denied:
'/execroot/.../python3.12/encodings/__init__.py'
```

The visible path is authorized, but actiondfs then opens its hidden ext4 CAS or
staging backing file with the already-confined task credentials. Landlock
evaluates that unrelated underlying path and rejects the internal open.

Follow Linux overlayfs's existing model: retain the mount creator's credentials,
temporarily override task credentials only while opening internal directory,
CAS, and staged backing files, then restore the caller immediately. The original
VFS/Landlock check still applies to the user-visible actiondfs path. Release the
saved credential when the superblock is destroyed.

Validated by rebuilding and booting the actual ARM64 guest kernel through
actiond (`f16f4f3f-df24-4954-8a61-793858c17bc7`, 943 real remote actions), then
rerunning both production sandbox seccomp cases with a real Landlock policy
(`08b932ab-9f76-4129-a0bb-3bba52793ea6`). The complete sandbox suite advanced
to 178 passing tests; remaining failures are independent guest capability gaps.
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.

1 participant