Repository navigation
kernel: lockdown's floor is integrity, and every machine but an enforcer's runs at confidentiality - #739
Merged
Conversation
…ery machine to confidentiality shirudo's BPF programs call bpf_probe_read_kernel, which confidentiality refuses (#734). The kernel now forces integrity, the floor no command line goes below, and machine.Cmdline puts lockdown=confidentiality on every line unless Cmdline.LockdownIntegrity (spin-machine --lockdown-integrity) asks for the floor. The zero value is confidentiality, so a consumer that builds its own Cmdline keeps today's level, and a lockdown= in Extra is refused. The level is the booted guest's, so it stays out of the record. The traceable kernel's swap is integrity to none, and a lab tree booting it passes --lockdown-integrity when its spin-machine would add lockdown=. boot:lockdown boots a guest at each level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ld by a test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Verified against shirudo itself before merging, in shirudo's own VM harness (shirudo main 5795f8d4, swtpm tpm-tis, dracut initrd). On this machine's 7.4-rc4 kernel with #735's config:
|
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Spinbox will run shirudo, a guest BPF LSM enforcer, in some workspaces. Its programs call
bpf_probe_read_kernel, which lockdown at confidentiality refuses, and this machine's kernel forced confidentiality. The maintainer chose a per-machine level on #734: the kernel's forced floor becomes integrity, and the machine raises every guest to confidentiality on the kernel command line unless its Spec says it runs an enforcer that needs integrity. A workspace without shirudo keeps exactly today's protection. This closes #734 once merged.What
kernel/config-7.4-x86_64forces integrity (CONFIG_LOCK_DOWN_KERNEL_FORCE_INTEGRITY=y). olddefconfig leaves it as committed, so the build's fixed-point check holds. Lockdown only rises (lock_kernel_down), so no command line can go below integrity.KERNEL_LOCKDOWNis nowintegrity|none. Its sed, its check,release traceable-kernel's config comparison (build.TraceableConfig) and the menuconfig build follow.machine.Cmdlinegets one new field,LockdownIntegrity bool. Its zero value is the safe one:Stringaddslockdown=confidentialityunless the field is set. A consumer that builds its ownCmdlineliteral, as spin does, gets confidentiality without asking.validaterefuses alockdown=inExtra. The kernel keeps the higher of two levels, so one there would silently undo the choice or claim a level the guest does not run.-appendsays. The level cannot make a resume load wrongly, soTargetandCanResumedo not carry it (docs/machine.md, "The kernel command line").spin-machine boot|args --lockdown-integrity.spin-machine boot, which would now addlockdown=confidentialityand lock the FORCE_NONE kernel. When a tree is made with--kernel traceable:TAG,MakeTreeasks the tree's spin-machine for its line (args). If the line carrieslockdown=, every boot of the tree gets--lockdown-integrity. It then asks again and refuses the tree iflockdown=is still there. A--spin-machine releasefrom before this change knows no such flag and adds nolockdown=, so it gets nothing, which keeps measuring.md's ledger recipe working on older releases.boot:lockdownaccepts a kernel from before shirudo: lockdown at confidentiality withholds bpf_probe_read_kernel from its programs #734 that forces confidentiality, and expects the integrity guest to read the forced level there. compat boots the newest release's kernel for any change that does not reach the kernel, and until a release carries this kernel that one forces confidentiality. boot:lockdown: drop the case for a kernel from before #734 once a release forces integrity #738 removes this allowance after the next release.Checked
task boot:lockdownon a lab tree of release v20261124.01 with this change's kernel (lab tree lock734 --from release --kernel $PWD/_output/kernel/vmlinux, laptop KVM):a machine at integrity asked for a level: ... lockdown=confidentialityand failed (--- FAIL: .../integrity).lab tree rel734 --from release, which forces confidentiality) passes both guests, each at[confidentiality].lab tree tr734 --from release --kernel traceable:v20261124.01wrote"boot": ["--lockdown-integrity"]into the manifest. A guest booted with that flag read[none] integrity confidentiality, and the same boot without it readnone integrity [confidentiality].spin-machine-dev release traceable-kernelbuilt locally. Its config isCONFIG_LOCK_DOWN_KERNEL_FORCE_NONE=ywith integrity and confidentiality both unset, and it passed the comparison against the committed config.go tool task lint test mutateaftergit fetch origin: all clean (mutate: 101 refused, 0 survived).The consumer: spin's
internal/runner/qemu/kernel_cmdline.gobuilds amachine.Cmdline{...}literal without the new field. With its zero value, spin getslockdown=confidentialityonce it bumps the machine module. Its tests match the line bycontains. Nothing to change in spin and no issue needed. A shirudo workspace setsLockdownIntegrity, and that is spin's change to make when it runs shirudo.🤖 Generated with Claude Code