scrotwmos security
This is the security record of scrotwmos as the code is today. It says what each part protects, how, with which keys, and where the code is. It ends with what is not protected.
Code locations are a path and a function name. A path alone means a whole file, a build rule or a kernel config fragment.
The feature list is in features.md. The appliance is described in appliance-os.md.
1. Threat model and trust boundaries
1.1 What scrotwmos defends against
- A lost or stolen machine. Data at rest is encrypted. The machine does not boot to a usable state without a username and password.
- A hostile session. A program in one session must not read or change another session, dom0, or the disk of another world.
- A hostile guest in a VM. A guest kernel that is fully compromised must stay inside its VMM process, and that process must stay inside its sandbox.
- Hostile network peers. A session must not reach the host, other sessions, or the LAN beyond its configured reach.
- Hostile devices. A USB device plugged in after boot must not become a keyboard without consent. A GPU or NIC given to a VM must not reach dom0 memory by DMA.
- A hostile backup place. A NAS or USB disk that holds backups sees only ciphertext and cannot change a copy without detection.
- A person with the disk but not the password, who wants to know which worlds exist. The answer is limited: see 3.2.
1.2 What scrotwmos does not defend against
- A person who can change the ESP and then waits for the owner to type the password. See section 7.
- Firmware, microcode, CPU or DMA attacks below the IOMMU.
- A compromised dom0 kernel. dom0 is the trusted base.
- An attacker who has the password.
- Denial of service by a session against the machine as a whole, beyond the limits a session’s config sets.
1.3 Trust boundaries
| Boundary | Trusted side | Untrusted side | Mechanism |
|---|---|---|---|
| Disk at rest | the running box | a disk off the box | dm-crypt, sealed blobs, keys.wrap |
| Boot image | the release key | the ESP | Ed25519 signature, AEAD seal |
| Monitor and compositor | root monitor (PID 1) | compositor as _swm |
fork before any parsing, request table |
| dom0 and a container | dom0 kernel and monitor | the container’s programs | namespaces, capability drop, seccomp, cgroups |
| dom0 and a VM | dom0 and the VMM sandbox | the guest | KVM, VMM seccomp, empty root, IOMMU |
| Session and session | dom0 | each session | separate uids, compositors, clipboards, networks |
| Session and network | the net VM router | each session port | nftables, layer 2 switch, VLAN tags |
| dom0 and the NICs | dom0 | NIC hardware and the network | net VM owns the NICs by VFIO |
| dom0 and USB | dom0 | devices plugged in later | USB authorization off, device stamps |
| Box and backup place | the box | NAS, SMB or USB place | ciphertext copies, sealed manifests |
The trusted computing base on the appliance is: the firmware, the
loader swmstub.efi, the dom0 kernel, and the root monitor in swm-wl.
The compositor is trusted with the screen and the keyboard, but not
with root.
2. Asset table
| Asset | Protection | Algorithm and parameters | Key origin | Code |
|---|---|---|---|---|
| World master (32 bytes) | wrapped in a keys.wrap slot | bcrypt_pbkdf(username, password, 16-byte salt, 16 rounds) to a 32-byte KEK; XSalsa20-Poly1305; container id as associated data | getentropy at install |
lib/libkeys/keys.c keys_slot_kek(), keys_unwrap(); lib/libkeys/keys_admin.c keys_slot_add() |
| World master, byol TPM path | wrapped under a TPM-sealed KEK | XSalsa20-Poly1305; TPM 2.0 keyedhash, PolicyPCR over PCRs 4, 7, 8 (SHA-256) | getentropy at preboot tpm on |
lib/libkeys/keys_admin.c keys_slot_add_tpm(); installer/tpm.c tpm_seal() |
| dom0 boot image | sealed and signed | XSalsa20-Poly1305 under a per-blob key; Ed25519 over SHA-512 of the header; header holds SHA-512 of the image | master; release key | lib/libkeys/keys.c keys_blob_open(), keys_image_accept() |
| World config | sealed | XSalsa20-Poly1305 under a per-blob key | master | lib/libkeys/keys.c keys_config_parse() |
| swmdata disk key (64 bytes) | sealed on the ESP per world | XSalsa20-Poly1305; the disk uses AES-XTS-512 | getentropy at install; one key for all worlds |
installer/provision.c luks_make(); lib/libsession/monitor_keys.c monitor_keys_take_disk_key() |
| Root, VM disk, kernel store images | derived key, never stored | SHA-512(master, label, image name) to 64 bytes; AES-XTS-512 | master | lib/libkeys/keys.c keys_data_key() |
| Home image key (64 bytes) | sealed on the ESP and in the place header | XSalsa20-Poly1305; AES-XTS-512 on the image | getentropy at install |
lib/libsession/monitor_keys.c monitor_keys_home_key() |
| Share image key | sealed in the store | XSalsa20-Poly1305; AES-XTS-512 | getentropy at install |
lib/libsession/monitor_keys.c monitor_keys_share() |
| Swap key (64 bytes) | never stored: in the monitor’s memory until the swap is mapped, then wiped | plain dm-crypt AES-XTS-512 | getentropy each boot |
lib/libsession/privsep.c monitor_swap_map() |
| Machine firmware archive | sealed on the ESP | XSalsa20-Poly1305 under a key from the disk key and the archive digest; digest pinned in the world config | disk key | lib/libkeys/keys.c keys_firmware_master() |
| ESP twin | none of its own: a copy of the ESP | as the ESP’s files | as the ESP’s | installer/appliance.c appliance_esp_close() |
| Boot handoff | channel only | plaintext in memory; wiped after use | loader | bin/swmstub/unlock.c handoff_offer(); lib/libsession/monitor_keys.c monitor_keys_ingest() |
| Screen-unlock verifier | slow hash | bcrypt_pbkdf(password, salt from the master, 16 rounds) to 32 bytes; constant-time compare | computed by the loader | lib/libkeys/keys.c keys_screen_hash(), keys_screen_verify() |
| Backup place header | password slot plus sealed part | one keys.wrap slot, empty username, 64 rounds; XSalsa20-Poly1305 | random place master | lib/libkeys/keys_place.c keys_place_header(), keys_place_open() |
| Backup copies | already ciphertext | the home image’s XTS sectors | home key | lib/libsession/mon_place.c copy() |
| Copy manifests and pins | sealed, chunk hashes | XSalsa20-Poly1305; SHA-512 per 1 to 16 MiB chunk | place manifest key | lib/libkeys/keys_place.c keys_manifest_build(), keys_pins_seal() |
| Recovery phrase key (16 bytes) | derived, never stored; shown as 12 words | SHA-512(master, label) cut to 16 bytes; a 4-bit checksum, the first four bits of the key’s SHA-256 (BIP-39’s) | master | lib/libkeys/keys.c keys_phrase_key(); lib/libkeys/keys_phrase.c keys_phrase_words(), keys_phrase_parse(), keys_phrase_canon() |
| World file | sealed on the place, two copies | XSalsa20-Poly1305: the master under a key from the home key and under the phrase key; the body under the master | master, home key | lib/libkeys/keys_place.c keys_world_seal(), keys_world_open(); lib/libsession/monitor_keys.c monitor_keys_world_seal() |
| World record (place, SMB credentials, Wi-Fi, settings) | sealed in the store | XSalsa20-Poly1305 | master | lib/libsession/monitor_keys.c monitor_keys_rec_write() |
| GPU and NIC records | sealed in the store | XSalsa20-Poly1305 | master | lib/libsession/monitor_keys.c monitor_keys_gpu_rec(), monitor_keys_nic_rec() |
| Wi-Fi WPA2 key | derived | PBKDF2-HMAC-SHA1, 4096 rounds, SSID salt | passphrase in the world record | lib/libkeys/keys_place.c keys_wifi_pmk() |
| Installer kernel | signed | Ed25519, same format as the dom0 image | installer key | bin/swmstub/swminstall.c efi_main() |
| VM kernels | signed index plus digests | signify (Ed25519) over the index; SHA-256 per blob | kernel key | lib/libsession/kernel_blob.c kernel_blob_resolve() |
| byol root | LUKS2 | argon2id, 5 s iteration time; AES-XTS-512; a second keyslot for the disk key at PBKDF2 1000 | user passphrase; random disk key | installer/plan.c plan_steps(); installer/preboot.c preboot_make() |
| byol root header copy | off the box, on the owner’s media; no password keyslot | the LUKS2 header with the disk key’s PBKDF2 keyslot alone | random disk key | installer/swmtool.8 (preboot passwd); installer/preboot.c disk_key() |
| byol swap | plain dm-crypt | AES-XTS-512, a new random key each boot | /dev/urandom |
installer/plan.c plan_steps() |
3. Encryption
3.1 Primitives
- XSalsa20-Poly1305 AEAD for small secrets, with associated data.
The Poly1305 key is the first 32 bytes of keystream. The tag is
checked before decryption. Keystream and MAC buffers are wiped on
every path.
lib/libkeys/aead.caead_seal(),aead_open(). - NaCl secretbox (XSalsa20-Poly1305) for bulk blobs. The tag is
checked before decryption.
lib/libkeys/secretbox.ckeys_secretbox(). - Ed25519 from TweetNaCl (vendored). SHA-512 is OpenBSD’s
sha512.c (
lib/libsignify); its calls that take a secret go throughkeys_secret_hash(), which wipes stack space after the hash.lib/libkeys/keys.ckeys_secret_hash(),keys_stack_wipe(). - bcrypt_pbkdf from OpenBSD (vendored), with its hash mapped to
TweetNaCl’s SHA-512.
lib/libkeys/VENDOR/. - PBKDF2-HMAC-SHA1 from OpenBSD, only for the WPA2 key.
- SHA-256 for VM kernel blobs, for TPM policy and PCR math, and
for the recovery phrase’s checksum, its stack wiped after.
lib/libdigest/sha256.c. - signify verification from OpenBSD (vendored).
lib/libsignify/verify.csignify_verify(). - Random numbers come from
getentropyin 256-byte chunks. A failure is an error, never a weaker fallback.lib/libkeys/keys_admin.ckeys_random(). The loader has no random source and makes no key: itsrandombyteshalts.bin/swmstub/rt.c. - Domain separation: every derivation uses a fixed label. No label
is a prefix of another. Variable data is framed with 64-bit lengths.
lib/libkeys/keys.ckeys_derive(). - Nonces: every XSalsa20 seal draws a fresh random 24-byte nonce under a key that itself depends on a fresh random salt. No nonce is reused. XTS is deterministic by design (see 3.6).
3.2 Key hierarchy (appliance)
username + password --bcrypt_pbkdf--> KEK --AEAD--> master (one per world)
master --SHA-512 labels--> blob names, blob keys, image keys,
time-travel names, screen salt,
recovery phrase key
master --sealed ESP blobs--> disk key, home key, world config, boot image
master --sealed store blobs--> share key, world record,
GPU and NIC records
disk key --> swmdata (layer 1); firmware blob key
getentropy, each boot --> swap key (never stored)
home key or phrase key --world file on the place--> master
A world is a master. An A/B world has two keys.wrap slots on one master: two usernames, two boot images, two configs, one root and one home. The rescue and decoy worlds are ordinary password slots.
Deniability is plausible, not cryptographic. All password slots
look the same. The file name of each blob is a hash under its master,
so no file names a world. But the number of live slots is visible, and
swmdata and every image carry a visible LUKS2 header.
lib/libkeys/keys.h (header comment).
Decided:
- The username picks the world and the slot. There is no boot menu. An A/B world has two usernames on one master; each opens its own boot image.
- One unwrap gives all of a world’s keys: the shared disk key and the world’s own image, home, and boot keys. No separate device key.
- One keys.wrap per world replaces the shared file, so the file no longer shows how many worlds exist. Deferred, not built (ROADMAP.md).
- Guest-keyed volumes are opt-in. A VM volume encrypted again under a key only the guest holds is the M4 class. Not built yet.
3.3 keys.wrap
- What: the file on the ESP that turns a username and password into a world master.
- Where:
lib/libkeys/keys.ckeys_unwrap(),keys_deserialize();lib/libkeys/keys_admin.ckeys_slot_add(),keys_rewrap(). - Format: version 3. Always 8 slots, always the same size. Each slot has a type, rounds, a 16-byte salt, a 24-byte nonce, the wrapped master and a 16-byte tag.
- KDF: bcrypt_pbkdf over the username, a NUL and the password. Default 16 rounds. The parser refuses fewer than 8 or more than 64. Every caller uses the default.
- Cipher: XSalsa20-Poly1305. The 32-byte container id is the associated data, so a slot moved to another file does not open.
- Unwrap: bcrypt runs for every slot, and the loop does not stop at the first match. Timing does not show which slot opened.
- Rewrap: a password change writes a new salt and nonce. The master does not change, so no data is re-encrypted.
- Lifetime: the master lives as long as the world. The KEK lives for one unwrap.
- Wipe: the KEK and scratch buffers are wiped on every pass. The password is wiped right after the unwrap.
- Why: a disk off the box gives no master without a password, and each guess costs a bcrypt run per slot.
- Not covered: the container header and slot metadata are not authenticated. A slot can be removed, or the file replaced by an older copy. See section 7.
3.4 Boot blobs and the world config
- What: the dom0 boot image (one per slot), the world config (one per slot), the disk key, the home key and the firmware archive.
- Where:
lib/libkeys/keys_admin.ckeys_blob_seal();lib/libkeys/keys.ckeys_blob_key(),keys_blob_open();bin/swmstub/swmstub.cefi_main(),config_build(). - Envelope: version byte, 16-byte salt, 24-byte nonce, length, ciphertext, 16-byte tag.
- Key: SHA-512 of the master, a label, the blob name and the salt, cut to 32 bytes. A new salt and nonce on every seal.
- Name: SHA-512 of the master, another label and the username. The name is public but says nothing about the master or the world.
- Firmware archive: keyed from the disk key and the archive digest, so one archive serves every world. Its digest is pinned in each world’s sealed config.
- World config: dom0.conf, dom0.fstab, host name, the boot image’s header digest, and the firmware digest. It is sealed, not signed.
- Pairing: the loader requires the boot image’s header digest to
equal the
bootfield of the world config. A mixed update or a swapped image does not boot. - Why: the ESP is plain FAT. These blobs keep it from showing or changing what each world boots.
3.5 Boot handoff and keys in dom0
- What: the master, the screen-unlock hash, the disk key and the home key, passed from the loader to the dom0 monitor.
- Where:
lib/libkeys/keys.ckeys_handoff_build(),keys_handoff_parse();bin/swmstub/unlock.chandoff_offer(),handoff_wipe();lib/libsession/monitor_keys.cmonitor_keys_load(),monitor_keys_ingest(),secrets_map(). - Channel: an initrd file of fixed layout and length, mode 0400, served through the UEFI LoadFile2 protocol. It is plaintext in RAM. The fixed length does not show which kind of world booted.
- Loader side: the copy is wiped when the kernel has taken it, and on lockout and halt. The stack is wiped before LoadImage.
- dom0 side: the monitor reads the file once, after the privilege fork, so the compositor never inherits it. The file must be a regular file with one link, owned by root, with no group or other bits, and of the exact length. Otherwise it is refused. In all cases it is zeroed, synced and unlinked.
- Memory: keys stay on their own pages with
mlock,MADV_DONTDUMPandMADV_WIPEONFORK. If wipe-on-fork fails, the monitor holds no keys. The monitor is not dumpable and has a core limit of 0. - Kernel: the dom0 kernel zeroes freed pages
(
CONFIG_INIT_ON_FREE_DEFAULT_ON).kernel/host.fragment. - Why: one password at the loader opens everything the world needs, without a second prompt and without the keys on disk.
3.6 Disk layers
The appliance disk is GPT: the ESP (the loader, keys.wrap, and the sealed blobs, all that the firmware must read in clear), an optional swap, swmdata, and, last, the ESP’s twin.
Decided: two layers of dm-crypt. swmdata is layer 1, for offline opacity, and every world opens it. Each session’s root, home, and disk are layer-2 images on swmdata, under keys only its world’s master gives, so a decoy that opens the disk cannot open another world’s images. fscrypt was rejected: it shows the directory tree, counts, sizes, and times to a booted decoy, and it serves containers only. Image names are random and never reused, because a name derives its image’s key.
All dm-crypt mappings in dom0 are made by ioctl on loop and
device-mapper devices. dom0 has no cryptsetup. Key-bearing ioctls carry
DM_SECURE_DATA_FLAG, and the key’s hex form is wiped after use.
lib/libsession/dmcrypt.c dmcrypt_open(), dm_load().
| Layer | What | Cipher | Key | Lifetime | Code |
|---|---|---|---|---|---|
| swmdata | the data partition | LUKS2 format, opened as raw aes-xts-plain64, 512-bit key, 4096-byte sectors, data at 16 MiB | disk key, random, one for all worlds | life of the box | installer/provision.c luks_make(); lib/libsession/privsep.c monitor_disks_open() |
| root image | a world’s root file system | aes-xts-plain64, 512-bit | keys_data_key(master, label) |
life of the image | lib/libsession/privsep.c monitor_image_setup() |
| VM disk, kernel store | a VM’s disk, the world’s VM kernels | aes-xts-plain64, 512-bit | keys_data_key(master, label) |
life of the image | lib/libsession/monitor_keys.c monitor_keys_session_key(), monitor_keys_kernels() |
| home image | a world’s or session’s home | aes-xts-plain64, 512-bit | random home key, sealed | life of the world | lib/libsession/monitor_keys.c monitor_keys_home_key() |
| share image | a world’s share | aes-xts-plain64, 512-bit | random share key, sealed in the store | life of the world | lib/libsession/privsep.c monitor_share_blob() |
| swap | the swap partition |
plain dm-crypt aes-xts-plain64, 512-bit | random, made by the monitor each boot and never stored; every world alike, rescue and the decoy too | one boot | lib/libsession/privsep.c monitor_swap_map(); lib/libsession/swap_part.c swap_hdr_make() |
- LUKS2 headers: the installer formats swmdata and every image as
LUKS2 with the volume key from a locked memfd. The keyslot gets a
random passphrase (PBKDF2, 1000 rounds) that is thrown away. dom0
never opens by header: it maps the data area at a fixed offset.
installer/provision.cluks_make(). - One writer: each image is locked so it is mapped once.
- ESP twin: a plain vfat copy of the ESP, made again at every
change to the ESP. It holds nothing that the ESP does not hold. It
has no key of its own.
swmtool esp restoremakes a dead ESP again from the twin, with no password. It refuses a twin older than a whole ESP’s keys.wrap. swmtool(8) gives the other refusals.installer/appliance.cappliance_esp_close();installer/upgrade.ccmd_esp(),esp_restore_check(). - Why: a disk off the box shows nothing but headers and ciphertext. Each world’s images are under keys only its master gives. Only the store directory layout and file sizes are visible to a world that opens swmdata.
- Store times: the access and modify times of every image and
point are set to one stamp, so file times do not show use.
lib/libsession/dom0_fstab.csession_store_stamp(). - Integrity: none at the dm-crypt layers. XTS detects no change. See section 7.
3.7 Lock screen
- Where:
bin/swm-wl/wl_lock.cdom0_lock_submit();lib/libsession/privsep.chandle_screen_verify();lib/libkeys/keys.ckeys_screen_verify(). - Verifier: bcrypt_pbkdf of the password, 16 rounds, salt SHA-512(master, label) cut to 16 bytes, compared in constant time. The loader computes it while the password and master are both in memory.
- Throttle: in the root monitor. After a deny, the next try in a window is denied without running bcrypt. The window starts at 1 s and doubles up to 60 s. A clock read failure denies.
- Fail closed: with no handoff there is no verifier, and every try is denied.
- Wipe: the compositor locks its password buffer in memory and wipes it on every path. The monitor wipes its copy.
- Why: the root monitor holds the verifier, so a compromised compositor cannot read it or skip the throttle.
- Panel acts: F11’s off, its delete of every point and its new
place, and F9’s ROM approval, send this password with the request.
The monitor checks it with the same verifier and the same throttle
before it acts:
lib/libtt/tt.ctt_pass_why(),lib/libsession/mon_scrub.cmon_scrub_approve(). A USB accept in F7 asks for no password. - What the panel password proves: a human is at a real keyboard, and each wrong guess adds to the backoff. It does not authenticate against an exploited compositor: the compositor sees each password typed into it and can send that password with any request.
- byol TPM boot: the session starts locked and
swaylockwith PAM unlocks it.installer/fill.cbyol_tpm().
3.8 Backup places
- Header: a keys.wrap with one slot, an empty username and 64
bcrypt rounds over a random place master. A sealed part holds the
manifest key, the names key, a generation, the home key and the
label. A header that is not exactly one slot at 64 rounds is refused
before bcrypt runs. Two copies are written and each is read back.
lib/libkeys/keys_place.ckeys_place_header(),hdr_wrap(),keys_place_open();lib/libsession/mon_place.chdr_write(). - Copies: the home image’s XTS ciphertext, byte for byte. The copy
child and ttvm hold no data key. Copy names are hashes of
the hour under the names key.
lib/libsession/mon_place.ccopy(). - Manifests: sealed under the manifest key. They hold a SHA-512
hash per chunk of 1 to 16 MiB. A changed or older chunk is detected
within one manifest generation.
lib/libkeys/keys_place.ckeys_manifest_build();lib/libsession/mon_place.chash_chunks(). - Password change: a new place master, new manifest and names keys.
Old manifests’ keys are kept in a sealed pins file, bound by name and
by the hash of each sealed manifest, so old copies still open.
lib/libkeys/keys_place.ckeys_place_rotate(),keys_pins_seal(). - Scrub: once a day the newest copy is read back and checked
against its manifest.
lib/libsession/mon_place.cscrub(). - Recovery phrase: the phrase key, SHA-512(master, label) cut to 16
bytes, written as 12 words of the BIP-39 English wordlist: the key’s
128 bits and a 4-bit checksum, 11 bits a word. The checksum is the
first four bits of the key’s SHA-256. These are BIP-39’s words and
checksum, not BIP-39’s seed: never type the phrase into wallet
software. The parser takes a word whole or by its
first four letters. The box stores no phrase.
swmtool place phrasederives it again from the master that the world’s password unwraps. It shows the phrase on a terminal only. On a place, the phrase opens the world’s file: its master is sealed under SHA-512(label, phrase key) cut to 32 bytes. On a byol box in mode D, the phrase is therecoveryslot’s password and LUKS keyslot 31’s, askeys_phrase_wordswrites it.lib/libkeys/keys.ckeys_phrase_key(),keys_world_phrase_key();lib/libkeys/keys_phrase.ckeys_phrase_words(),keys_phrase_parse(),keys_phrase_canon();installer/upgrade.cupgrade_phrase_say(),phrase_ask(). - World file:
w0andw1, beside the headersh0andh1. The root monitor seals the file. It writesw1, thenw0, at every copy and every scrub, and reads each one back. It has one fixed length (KEYS_WORLD_LEN, just over 64 KiB), whatever it holds. Format: the magicSWMWORLD, a version, 12 random id bytes made at each seal; the master sealed under SHA-512(label, home key) cut to 32 bytes; the master sealed under the phrase key; the body sealed under the master, with a generation (the job’s time, which tells the newer copy apart) and padded to 64 KiB. Each part is a sealed blob (3.4) named with the id, so parts of two seals do not open as one file. The body is the world record, dom0.conf, and the host name. It leaves out what is the box’s or the moment’s: the screen hash, the anchor, the old keys of a password change, the fstab, the firmware, and the boot digest.lib/libkeys/keys_place.ckeys_world_seal(),keys_world_open(),keys_world_state_build();lib/libsession/monitor_keys.cmonitor_keys_world_seal();lib/libsession/mon_place.cworld_put(). - A world on a new box:
swmtool place worldopens the world’s file by the header’s home key (the password) or by the phrase key. Then it rewraps the new install’s keys.wrap slots over the dead box’s master. When it opens by the password, it shows the phrase’s first four words and asks for yes. It asks because anyone with the place and the password can write a world’s file. The new box keeps its own disk key.installer/upgrade.crestore_open(),world_rekey(). - What each holder gets:
- The place alone: ciphertext, the headers, and the world’s file. The one way in is to guess the password against the header (bcrypt, 64 rounds). The phrase key and the home key are not guessable.
- The place and the password: the header gives the home key, the home key opens the world’s file, and the file gives the master. That is the whole world: every copy, the world record (place keys, SMB credentials, Wi-Fi passwords), its config, and every key the master derives.
- The place and the phrase: the same, with no password.
- The phrase alone: nothing. The file it opens is only on the place.
- The box: no phrase and no world’s file. A world’s password on the box shows that world’s phrase.
- Why: a place is outside the box. It must see only ciphertext and must not be able to change a copy without detection. The world’s file lets a world outlive its box.
3.9 Other secrets
- Share, world record, GPU and NIC records: sealed in the
store under the master. One blob of one size per world, so a world
that does not share still has a share blob.
lib/libsession/monitor_keys.c. - SMB credentials and Wi-Fi networks: in the sealed world record.
dom0 sends one join at a time to the net VM, with a WPA3 password or
a WPA2 PMK, never a WPA2 passphrase. No SSID or key is logged.
lib/libsession/mon_wifi.cmon_wifi_choose(). - Time-travel directory names: derived from the master and the
session name, so a directory names no session.
lib/libkeys/keys.ckeys_tt_dir().
3.10 byol
- Root: LUKS2, AES-XTS-512, argon2id with a 5 s iteration time,
under the user’s passphrase. A second keyslot holds a random 64-byte
disk key at PBKDF2 1000 rounds.
installer/plan.cplan_steps();installer/preboot.cpreboot_make(). - Install’s password: the first line of
--passphrase-file, or asked at a terminal. Never from argv or the environment, which every step install forks would inherit. The file is read as a--passwordsfile: a pipe on-, the standard input, or a regular file of the installer’s own, mode 0600 or tighter; 8 KiB at most; into locked memory, wiped on every path.installer/install.cread_passphrase();installer/appliance.cappliance_passfile(). - keys.wrap: two slots, the user and
rescue, both under the disk passphrase. They wrap the master that opens the sealed disk key. - Boot: byolstub passes the disk key to dracut as an extra initrd
file. dracut falls back to the passphrase.
lib/libkeys/keys.ckeys_rootkey_cpio(). - Root header copy: made by hand on the owner’s media, as
swmtool(8) shows under
preboot passwd. It holds the volume key under the disk key’s PBKDF2 keyslot alone, so no old password opens it. It stays good across a password change, but not acrosscryptsetup reencryptorpreboot make. After a restore,preboot passwdopens the root by the disk key. It unseals that key from the ESP under the master. Then it adds the new password’s argon2id keyslot again. In TPM-and-password mode (D) the root has no password keyslot: the copy is stripped of the recovery phrase’s keyslot 31, andpreboot passwdadds none.installer/preboot.cdisk_key(),preboot_passwd(). - Swap: plain dm-crypt with a new random key each boot.
- TPM KEK:
/etc/swm/tpm.kek, mode 0600, on the encrypted root.
4. Signatures
4.1 Signed objects
| Object | Signer key | Algorithm | Signed by (build) | Verified by (code) | On failure |
|---|---|---|---|---|---|
dom0.signed (dom0 kernel image) |
release | Ed25519 over SHA-512 of a 120-byte header; header holds arch, version, date, handoff version, key number and the image’s SHA-512 | make release, swmtool release sign -r |
loader: bin/swmstub/swmstub.c efi_main() via keys_image_accept(); installer: installer/provision.c provision_image_bad(); update: installer/upgrade.c upgrade_boot() |
loader prints an error and halts; swmtool refuses |
swmstub.signed (the loader) |
release | same, handoff 0 | make release |
installer/upgrade.c upgrade_stub_bad() |
update refuses the new loader |
installer.signed (installer kernel) |
installer | same, handoff 0 | make release, swmtool release sign -i |
bin/swmstub/swminstall.c efi_main() |
the media loader halts |
VM kernel index |
kernel | signify (Ed25519) over the index; each line names a flavor, version, SHA-256 and file | make kernel |
lib/libsession/kernel_blob.c kernel_blob_resolve(); installer/kernels.c index_read(), cmd_kernel_verify() |
the VM does not start; install lays no blob |
| Void packages | Void’s repository keys | RSA (xbps) | upstream | xbps | xbps refuses |
4.2 How a check works
keys_image_verify()checks the key number, the exact length, the signature over the header, and then the image hash.keys_image_accept()also checks the arch and the handoff version. A dom0 image and a loader, both signed by the release key, are told apart by the handoff field.lib/libkeys/keys.c.- The loader also requires the header digest to equal the world
config’s
bootfield. - swmtool checks the new dom0 image and the new loader before it writes either. The new loader must embed the same pinned release key.
- The VM kernel index is checked before any blob is read. Opens use the beneath rule, and the directory is treated as hostile.
4.3 Key custody and test keys
- Pinned key, no default: the loader does not compile without a
pinned key (
#error). swmtool without a key lays down and updates no appliance.bin/swmstub/key.c;installer/appliance.cappliance_release_key(). - Separate keys: the build refuses a release key equal to the
installer key.
lib/libkeys/release.mk. - Test keys:
RELEASE_KEY=testuses the RFC 8032 test keys. The build detects them by their bytes, whatever their name. Such a build prints a message at compile time, and the loader shows** TEST KEY -- NOT FOR PRODUCTION **on every boot. swmtool says so too. A key directory with anot-a-releasefile is shown as a nightly key.bin/swmstub/key.cpinned_warning();installer/appliance.cappliance_not_release(). - Media default:
make mediaandinstall-mediahave none. They stop unlessRELEASE_KEYistestor names a key directory.check-applianceandinstall-proofuse the test keys unlessRELEASE_KEYnames a key directory: the proof media takes its plan from qemu only when it is TEST media. Every other check goal takes the TEST kernel key alone. The result is loud but not refused. A test build also includes test-only behavior, such as a crash key in the compositor. - Secret keys in the tree: only test keys, under
regress/signify/and in the regression sources.release/keys/holds public keys only. CI writes the nightly secret keys from forge secrets with umask 077 and removes them at the end. - Kernel key: it follows
RELEASE_KEY.RELEASE_KEY=testuses the TEST kernel key,regress/signify/test-kernel.pub, whose secret is in the tree; so does a check goal whenRELEASE_KEYis unset. The build says so on every make. A key directory gives itskernel.pub, never the TEST kernel key, and its secret half isSCROTWMOS_KEYDIR’skernel.sec. With noRELEASE_KEYthe other goals that sign a kernel stop. The build copies the public half tokernel/keys/kernel.pub, the file the launcher pins, and that the package and byol’s tree carry. Each signature is checked against it before it is kept, so a secret key that is not its half signs nothing.Makefileksign;lib/libkeys/release.mk. - Downloads: release and kernel downloads may use plain HTTP. Each payload is signature-checked. Kernel and NVIDIA source tarballs are fetched over HTTPS and pinned by SHA-256.
- Kernel modules: the dom0, net VM, gfx VM, ttvm and screen
kernels have no module support. guest-std has modules without module
signing, and the guest seals module loading at run time
(
modules_disabled).
5. TPM and measured boot
The appliance measures its boot; the TPM holds no key. The
installer refuses tpm for a dom0 install. installer/answer.c
answer_parse(). The TPM seals only the optional TOTP codes.
- Measure: swmstub measures the SHA-512 of the boot image’s signed
header into PCR 8 through EFI_TCG2, before StartImage. The header
holds the digest of the image: the kernel, its initramfs and its
command line. It is a release’s: worlds on one release measure the
same, but each world takes an update by itself, so a world not yet
updated measures an older one, and its PCR 8 tells it apart. The
config, the username and
keys.wrapare each a world’s, so they are not measured.bin/swmstub/measure.ctpm_measure();bin/swmstub/swmstub.cefi_main(). - The handoff is not measured: the kernel’s EFI stub would measure
the initrd into PCR 9. That initrd holds the world’s config and keys,
so its digest would name the world booted. A kernel patch loads it
unmeasured.
kernel/patches/0019-efi-the-stub-s-initrd-unmeasured.patch;CONFIG_EFI_STUB_INITRD_UNMEASUREDinkernel/host.fragment. - dom0’s driver: the dom0 kernel has the TPM driver (CRB and TIS)
and securityfs, so dom0 reads the PCRs and the event log.
kernel/host.fragment. - TOTP codes (optional): offered with the install’s questions,
before the disk is written (provision lays the seal and the mark in
its keys.wrap), or
swmtool totp onfrom the stick, with any world’s password and swmdata open (swmtool unlock), as for an update-boot that must turn them off: keys.wrap is written only after swmdata’s journal of a cut off change of worlds is taken back. Two 20-byte secrets, the box’s, every world’s alike, sealed in the ESP’stotpto the loader’s PCR 4 and 7 with PCR 8 empty; no copy on the disk. keys.wrap’s TOTP field says on or off and the seal’s digest, under a MAC from the disk key. swmstub unseals before the prompt and caps PCR 8; it shows the loader code (a fake loader cannot) and asks the login code first; after the unlock, on every boot, it halts when the field says on and the seal is gone or another, or says off and a seal is there (“codes gone; tampering suspected”), and when the world’s disk key does not open (“codes not checked”). A loader that changes turns the old codes off, then takes new ones if asked, at update-boot. A TPM that refuses halts the boot; the stick’stotp off, thenon. A second factor of sorts: the disk keys do not go through the TPM, so a disk copy, or the ESP written with any world’s disk key, or the stick, opens a world by its password alone; an old mark “off” put back, carved from the ESP’s free clusters or in a whole old keys.wrap, is not seen until the TPM NV counter (ROADMAP). With Secure Boot off, a boot driver from the ESP runs beside the loader and can read the codes. A serial console keeps what enrollment shows. The clock is as on byol’s: not trusted (doc/design-dom0-tpm.md, “TOTP codes”).bin/swmstub/swmstub.ccodes_take(),disk_take();lib/libkeys/keys.ckeys_totp_mark_check();installer/tpm.ctpm_totp_sealed();installer/upgrade.ccmd_totp(),totp_again().
On byol:
- Measure: byolstub measures the newest kernel, the initrd and the
command line file into PCR 8 through EFI_TCG2.
bin/swmstub/tpm.ctpm_measure(). - Policy: one PolicyPCR over PCRs 4, 7 and 8 in the SHA-256
bank. The sealed object is a keyedhash with no password use and
with dictionary-attack protection off. The storage key is ECC P-256
from a fixed template, with empty auth. Nothing is written to TPM
NV memory.
lib/libtpm/tpm2.c;lib/libkeys/keys.h(KEYS_BYOL_TPM_PCRS). - Seal:
swmtool preboot tpm sealcomputes PCR 8, replays PCR 7 from the event log, and computes PCR 4 from the log up to the loader plus the loader’s Authenticode digest on the ESP. It first checks the full replay against the live PCRs. A runit service seals at first boot, and the kernel hook reseals for each new kernel. The seal refuses a kernel, initrd, command line or stub the root did not make; the hook makes the ESP from the root. Not sealed: the list’s order (a rollback to a kernel the root still has). A changed initrd booted with the password runs as root and can write the sums. doc/design-byol-tpm.md, “What the seal trusts”.installer/tpm.ctpm_seal(),seal_kernels(),esp_made(),evlog_replay(),pcr4(),pcr8();installer/plan.cplan_preboot_hook. - Cap: after it unseals, byolstub extends PCR 8 again, so the
running OS cannot unseal a second time. If the cap fails, the loader
wipes the master and asks for the password.
bin/swmstub/tpm.ctpm_cap();bin/swmstub/byolstub.ctpm_try(). - Fallback: on any TPM failure, the password. When PCR 4, 7 or 8
is not the sealed value (TPMRCPOLICY_FAIL), the loader also warns
that tampering is suspected.
bin/swmstub/tpm.ctpm_unseal(). - TPM and password (D):
swmtool preboot tpm password. Each slot wraps the master under SHA-512 of a label, bcrypt of the username and password, and the unsealed KEK: neither opens it alone. The password slots and the root’s LUKS passphrase keyslot are removed; the 128-bit recovery phrase (above) is a slot and LUKS keyslot 31, the only way in when the TPM refuses. The loader never asks it: a D boot the TPM gives no KEK halts (“TPM gave no key: recover from install stick”, or, the PCRs changed, “tampering suspected”), and its prompt refuses the recovery slot: a loader that asks the phrase is a fake.swmtool recover, on the install stick, checks the phrase against the recovery slot, opens the root by the disk key, lays the root’s kernels, initrds, command line and stub by its kernel hook (the ESP’s are the ones that halted), then wraps D’s slots again under a new password and a new KEK, with password slots beside them, and removes the seals: the next boot asks the password once and seals again (doc/design-byol-tpm.md, “Recovery”). Those password slots, on the FAT ESP, stay in freed clusters after the seal: disk and password open D with no TPM.swmtool updateon a D disk seals from the stick instead. The phrase is unchanged: one phished once opens the box for ever. An install’s D shows the phrase at the first boot, from the stub, until the first seal: the ESP marker is a hash of the master and D’s slots’ salts (keys_phrase_mark), which a planted file is not and a recover changes.swmtool preboot tpm phraseshows it again by the TPM and the password. A failed cap costs nothing in D: every D boot is a password boot, and the root holds the KEK.lib/libkeys/keys.ckeys_slot_kek();installer/tpm.ctpm_password(),preboot_tpm_recover();bin/swmstub/unlock.cunlock(). - TOTP codes (D, optional):
swmtool totp on. Two 20-byte secrets, each enrolled on a phone, sealed after the KEK in the same file. The stub shows the loader’s RFC 6238 code (HMAC-SHA-1, 30 s, 6 digits) before the prompt: a fake stub cannot unseal it, so it cannot show it, and the user types nothing. The login’s code is typed first, before the username and the password, and checked again after the password: the phone is a second factor, no password is asked without it, and a wrong code is a try spent. The RTC must keep UTC.swmtool recovertakes no code. The RTC is not trusted: one set ahead shows future loader codes, one set back takes a recorded login code again (no TPM NV floor), and nothing counts wrong codes across boots (3 a boot; PolicyAuthValue’s lockout is the fix) (doc/design-byol-tpm.md, “D’s slots and boot”).totp onandtotp offask the login;tpm offthe password.lib/libkeys/keys_totp.ckeys_totp();bin/swmstub/totp.ctotp_show(),totp_ok();bin/swmstub/unlock.cunlock();installer/tpm.cpreboot_tpm_totp(). - Session: salted to the SRK (ECDH, P-256) and unbound. The KEK
crosses the bus encrypted (XOR, a KDFa mask), commands and responses
carry HMACs, and the sealed file pins the SRK’s name. The salt’s key
comes from getentropy, or in the stub from RDSEED/RDRAND and
EFIRNGPROTOCOL, never from the TPM.
lib/libtpm/tpm2.csess_start(),put_sess(),rsp_sess();bin/swmstub/rng.crng_buf().
6. Isolation
6.1 Privilege separation in dom0
- Fork before parsing: swm-wl starts as root (PID 1 on the
appliance) and forks before wlroots starts. The parent stays root as
the monitor. The child sets its groups, gid and uid to
_swm, checks that the drop held, and is not dumpable. Root with no target uid, uid 0 or gid 0 is refused.lib/libsession/privsep.cprivsep_init(). - Compositor filter (appliance, PID 1 only): no-new-privs and a
seccomp filter that refuses exec, ptrace, processvm, bpf,
userfaultfd, perf, keyrings, kexec, every mount call, chroot,
pivotroot, unshare, setns, clone3, io_uring, and clone with any
namespace flag. DRM ioctls are on an allowlist; any other DRM ioctl
kills the compositor. It fails closed.
lib/libsession/seccomp_dom0.cseccomp_dom0_compositor();bin/swm-wl/main.cmain(). - The monitor is the trusted base. It has no seccomp filter, no capability drop and no namespace. It closes every descriptor but its channels, is not dumpable, and has a core limit of 0.
- Channels: a request/reply socket, a sync channel and an async
channel. The sync channel refuses descriptor passing into the monitor
(
SO_PASSRIGHTSoff). This needs Linux 6.16 or later, and fails closed without it.lib/libsession/mon_sync.c. - Request table: 22 operations, each with a fixed-size body and its
own checks. Strings are bounded and NUL-terminated. A short read ends
the monitor.
lib/libsession/privsep.cmonitor_ops[].
| Operation | What root does | Checks in the monitor |
|---|---|---|
| CREATE | starts a container or VM | magic, version, a 64 KiB string table, exact counts; the uid is forced to the session uid; seccomp is forced on; GPU use is forced by session kind; the rescue session only as the sealed config says; image, home, uid and share must match the sealed config; root paths only under the store; no trunk or gfx launch; uid rules (handle_create(), helper_validate(), session_pin_ok(), session_uid_ok()) |
| DESTROY | stops a session | name grammar, a capped timeout |
| SCREEN_VERIFY | checks the lock password | throttle; the answer is match or deny only |
| TMSET, TMSTATUS, TM_LIST | points on or off, delete, mount, unmount, take one now, consolidate, look, make a place | shape checks; mount and look refused for VM images (tt_set()) |
| SETTINGS | writes the world’s input settings | record checks |
| WIFI | saved networks, add, forget, choose | record checks; at most 3 keys per scan cycle |
| GPUAPPROVE, GPUREVOKE, GPU_ROMS | records or removes a ROM approval | the card must be at the address, with matching ids, held for a ROM reason |
| NIC_MEASURE | measures a NIC in a scratch VM | address and state checks |
| DEVICE | USB take, check, scan, accept, kept | only inside a time window (6.6) |
| SLEEP | suspend to RAM | none |
| status and log reads | fixed records | none |
- Time from the net VM: the only value that crosses is the clock
offset. dom0 slews at most 128 ms per 32 s, steps once per boot (at
most 366 days, within 60 s of the net VM’s start), and never goes
below a floor kept on disk.
lib/libsession/net_time.cnet_time_judge().
6.2 Container tier
Path: lib/libsession/privsep.c handle_create(), then
lib/libsession/session.c session_launch(), child_setup(),
setup_rootfs(), setup_rootfs_inner(), child_exec().
- Namespaces: mount, PID, UTS, IPC and cgroup, plus network unless the session uses the host network. No user namespace: the session uid is a real host uid, at least 500000, unique, and not in passwd.
- Root: a store root (
/srv/<label>) is pinned by inode and walked before the fork, then cloned read-only, nosuid, nodev. An image root is mounted read-only, nosuid, nodev. Then pivot_root, and the old root is detached. - Inside:
/procnosuid, nodev, noexec. A new read-only sysfs./tmpand/runas small tmpfs, nosuid, nodev. A tmpfs/devwith only null, zero, full, random, urandom, tty, a new devpts and shm. - Mounts: up to 32. The source is opened as the session uid and checked for the access asked. Placed nosuid and nodev through a beneath, no-symlink target. Reserved targets are refused.
- Last pass: every mount but the writable ones is remounted
read-only, nosuid, nodev.
remount_recursive_ro(). - Capabilities: no-new-privs, ambient and bounding sets cleared,
then setgroups, setgid, setuid, then the rest cleared.
lib/libsession/session_caps.csession_caps_drop_phase1(),session_caps_become(). - Processes: a relay in the host PID namespace and a reaper as
PID 1, each under a seccomp filter that kills on any call off a short
list. The application gets the application filter.
lib/libsession/seccomp_relay.c. - Application filter: an allowlist that returns EPERM. It refuses
the mount API, pivotroot, ptrace, processvm, io_uring, bpf, perf,
userfaultfd, keyrings, kexec, reboot, settimeofday, module loading,
swapon and
open_by_handle_at. It allows user and network namespace creation, for browser sandboxes. The filter checks the architecture and kills on a foreign one or on x32.lib/libsession/seccomp_app.cseccomp_app_install();lib/libsession/seccomp.c. - Descriptors and environment: all but kept descriptors closed, an explicit environment, a parent-death signal, no core dumps, at most 4096 open files.
- cgroups: each session has its own cgroup under
/sys/fs/cgroup/scrotwm. Memory, swap, pids and CPU limits come from the session config. On removal the group is killed whole.lib/libsession/session.ccgroup_setup(),cgroup_remove(). - D-Bus: each container that drops root gets its own system bus:
its root’s dbus-daemon, run as the session uid after the drop and
under the application filter, with no environment and no system.d
policy. A session that keeps uid 0 gets none.
lib/libsession/dbus.csession_dbus_system_start();lib/libsession/session.cchild_exec().
6.3 VM tier
- VMM sandbox: swm-vmm is started by the monitor in its own mount,
IPC, UTS, cgroup and network namespaces. Its root is a tiny tmpfs,
read-only, nosuid, nodev, noexec, with only a
/procthat hides other processes. It is executed by descriptor, never by path. It runs as the session uid with no capabilities, no core dumps, and not dumpable. The host network is refused for a VM.lib/libsession/session.cchild_setup(),setup_vmm_root(). - Descriptors only: the disk, kernel, initrd,
/dev/kvm, VFIO, network, share and gfx channels arrive as open descriptors. All others are closed.lib/libsession/session.csession_bus_argv(). - Kernel: always held to a digest from the signed index.
- VMM filter: default kill. No mmap, socket, connect, clone or
exec. KVM ioctls limited to run, IRQ line and register reads. Extra
rules only for the roles that need them: share, trunk, gfx and VFIO.
Installed after setup, before the guest runs.
vmm/seccomp_vmm.cvmm_seccomp_install(). - brk-only heap: lets the filter refuse mmap.
vmm/brk_malloc.c. - Guest-controlled lengths: every guest address and length is
checked against guest RAM. Virtqueue sizes, indexes, chains and
indirect tables are bounded. A bad queue stops the device and the
guest. Each device checks its own request sizes.
vmm/virtqueue.c,vmm/kvm.c,vmm/virtio_*.c,vmm/pci.c. - Devices offered: console (the bus), block, a read-only point disk, virtio-fs, balloon, net, GPU, and VFIO functions. No USB, no audio, no virtio-input. Input reaches a guest as messages on the console.
- virtio-fs: the FUSE server runs inside the VMM sandbox, as the
session uid. Every walk is beneath a pinned directory with no
symlinks. No device nodes, symlinks or hard links can be made.
vmm/fuse_srv.c. - Guest compositor: under the application filter before its first
client.
bin/scrotwmd/main.cmain().
6.4 Network filtering
- No firewall program: nftables rules are built as netlink batches.
One ip table,
swm-nat, for IPv4, and an ip6 table of the same name for the IPv6 backstop.lib/libsession/net_nat.cnet_nat_ensure(). - IPv6 off: IPv6 is turned off by sysctl on every tap, on the
uplink and in each container’s network namespace.
lib/libsession/net_tap.c. - IPv6 backstop: the ip6 table’s forward chain drops all IPv6 in
from a session port and all IPv6 out to a session port. The net VM
kernel has no IPv6, so there it has no ip6 table.
lib/libsession/net_nat.cnet_nat_ensure(). - Where it runs: in dom0 for routed VM taps, and in the net VM for the switch ports.
- Rules from a session port: drop a source with no route back out that port; drop all traffic to the router itself; drop invalid and untracked flows; drop a source that is not the port’s own address; limit new flows per source; cap connections per source; drop client to client; drop private and link-local ranges unless the session has LAN reach. Masquerade only out the uplink.
- Reach: guest is the internet only, lan is the LAN only, full is
both, none has no network.
lib/libsession/net_nat.cnet_nat_reach(). - Uplink closed first: before the first address, new inbound and
forwarded traffic on the uplink is dropped. If this fails, there is
no address.
lib/libsession/net_nat.cnet_nat_uplink_close(). - Switch: port to trunk only, one VLAN tag per port, no MAC
learning, no flooding, no IP parsing. Tagged frames from a client
are dropped. Descriptor passing is off on both ends. Rate limited.
lib/libsession/net_switch.cnet_switch_up(),net_switch_down(). - Net VM: owns the NICs whole, by VFIO. dom0 has no NIC driver.
- DHCP engine: a separate process with its own uid, an empty
network namespace, no-new-privs, tight rlimits and a kill-on-violation
filter. Every length in a packet is checked. The monitor checks the
lease again and applies it.
lib/libsession/net_dhcp.cnet_dhcp_engine_main(),net_dhcp_parse(),net_dhcp_lease_valid(). - NTP: OpenBSD ntpd in the net VM, with pledge emulated by
seccomp. Its uid may only send UDP 123 to its servers.
bin/swm-ntp/pledge.cpledge(). - No listeners: nothing in dom0 listens on an IP socket. The only listening socket is the seat socket.
6.5 IOMMU and VFIO
- IOMMU on by kernel config: the dom0 command line is fixed and
holds no IOMMU option. The config turns Intel VT-d on by default,
with interrupt remapping, strict DMA (no lazy, no passthrough), and
PCI DMA off at EFI exit. No-IOMMU VFIO, IOMMUFD, SR-IOV, P2P DMA,
USB4 and PCIe hotplug are off.
kernel/host.fragment,kernel/host.fragment.x86_64. - Held at boot: display and accelerator class devices are bound to pci-stub from the command line, except the boot display.
- Gate before passthrough: a strict DMA domain, interrupt remapping
with unsafe interrupts refused, no direct reserved region, a working
reset, not removable or Thunderbolt, a clean group and slot, and ATS
off.
lib/libsession/gpu.cgpu_gate(). - In the VMM: the group must be viable. One DMA map of guest RAM
after the reset. The ROM BAR and I/O port BARs are never exposed.
Config writes pass only memory, bus master and INTx-disable.
vmm/vfio.c. - Hand-off cycle: take, probe and hold steps each run in a child,
so a hung sysfs write does not block dom0. A GPU’s ROM digest is
sealed per world and needs approval.
lib/libsession/mon_scrub.c. - Config space read only: dom0 reads a GPU’s config space through sysfs and never writes it there; lockdown refuses that write. The probe’s one write, Memory Space Enable, goes through VFIO. A hold says the Device Status error bits and leaves them set.
6.6 USB and input
- Hotplug off by default: only
allow_hotplug=1in dom0.conf turns it on. - Boot window: devices present during boot are accepted. Then the
monitor turns USB authorization off and stamps each present device.
lib/libsession/privsep.cdevice_shut(). - Later devices: a device is let in only inside a short window
(wake, an F7 scan, a VT return), and only if its stamp is kept or it
is accepted in F7.
lib/libsession/privsep.chandle_device(),uevent_wake_pass(). - Seat: an input device that is not kept is not attached.
- Seat server: the monitor serves the seat socket only to the
compositor’s pid. It opens only paths under
/dev/driand/dev/input, and then only if the opened descriptor is a DRM or input character device.lib/libsession/seat.cseat_path_permitted(),seat_open_device(). - Key routing: VT, power, panel and lock keys first. Under the
lock, only the lock. Then bindings. Other keys go only to the
focused workspace’s session.
bin/swm-wl/main.ckeyboard_handle_key(). - Keyboard trust: destructive panel actions need a real keyboard.
bin/swm-wl/wl_gate.h. - Lock screen: drawn above the desktop, which is disabled while
locked. A crashed lock client leaves the screen locked.
bin/swm-wl/wl_lock.c. - World mark: two words and a color from the world key, drawn only
by dom0 on the lock and on secret prompts. A session cannot draw it.
lib/libsession/world_mark.cworld_mark_from(). - Cursor tag: the cursor shows which session has the keyboard.
bin/swm-wl/wl_cursor.ctag_now().
6.7 Clipboard
There is no path for clipboard data between sessions. Each session’s
compositor has its own selection. The bus carries only a sync flag.
dom0 has no data-control protocol, and refuses selection changes while
locked. bin/swm-wl/wl_clip.c, bin/swm-wl/wl_clip.h.
6.8 GPU
- dom0 renders with the CPU (pixman). Its DRM ioctl allowlist keeps KMS and buffer sharing only.
- Containers: render nodes only, never card nodes, never the DRM
master.
lib/libsession/session.csetup_gpu(). - VMs, 3D: one vmm-gfx per VM in its own jail, uid and root, with
only the render node and a sysfs subset. Its filter defaults to kill
and refuses perf, flink, set-master and KMS ioctls.
bin/vmm-gfx/seccomp_gfx.cgfx_seccomp_install(). - gfx VM: Venus runs in a VM with per-slot jails.
- Whole GPU: by VFIO, through the gate in 6.5.
- Hang blame: a GPU hang is mapped to the owning session.
- Priority: the screen’s vmm-gfx keeps
CAP_SYS_NICEalone for its context. The seat gives the master only to the compositor.
6.9 dom0 attack surface
| Input | Parsed by | Privilege | Checks |
|---|---|---|---|
| Session bus messages | compositor | _swm, dom0 filter |
exact length per type, direction, field bounds; shared memory must be sealed against shrink |
| dma-buf frames | compositor | _swm |
import checks |
| Wayland socket | compositor | _swm, directory 0700 |
only _swm and root reach it; dom0 runs no clients |
| Seat socket | monitor | root | compositor pid only; path and device class checks |
| Monitor channels | monitor | root | 6.1 |
| Kernel uevents | monitor | root | relayed only inside windows |
| DHCP packets | DHCP engine | own uid, sandbox | 6.4 |
| Net VM records | compositor, then monitor | _swm, root |
fixed records; time judged |
| Backup VM wire | monitor children | root | magic, length cap, exact size per command |
| Place headers and manifests | monitor children | root; the copy child is under seccomp | exact sizes, rounds pinned, AEAD |
| Point file systems | dom0 kernel | root child | only container homes, which dom0’s kernel wrote; VM homes are never mounted in dom0 |
| Guest virtio, FUSE, PCI | swm-vmm | session uid, sandbox | 6.3 |
| GPU command streams | vmm-gfx | own uid, filter | 6.8 |
| ESP keymap | compositor | _swm |
none (section 7) |
| Sealed config | PID 1 before the fork | root | AEAD under the master |
- Kernel lockdown: the dom0 kernel is locked down, confidentiality,
forced by its config (not a command line word), and in force before
the command line’s parameters are parsed, whatever LSM list it
names. Root cannot change the running kernel or read its memory: no
writes to PCI config space or BARs through sysfs or
/proc, no I/O ports, no MSRs, no perf interrupt registers. VFIO is not under lockdown. The installer kernel, merged over the dom0’s, is locked down too. - Not built: kexec, hibernation,
/dev/mem,/dev/port,/proc/kcore, debugfs, the BPF syscall, kprobes, ftrace, modules, efivarfs, SysRq,/dev/cpu/*/msr, iopl and ioperm, and ACPI tables from outside the firmware (an initrd’s, or an SSDT from an EFI variable).modify_ldtstays: containers share the dom0 kernel, and Wine needs it. The installer turns SysRq back on: its media has no init system.kernel/host.fragment,kernel/host.fragment.x86_64;regress/test_kcfg_lockdown.shholds the fragments to these lines.
6.10 No daemons in dom0
- Three programs: the dom0 image holds only swm-wl, swm-vmm and
vmm-gfx as executables, all static. No setuid binaries.
/initis swm-wl.mk/dom0-payload.mk. - dom0 runs no program: spawns, search menus, autorun, the bar
script and host sessions are refused. The compositor’s filter also
refuses exec.
bin/swm-wl/wl_session.csession_bus_launch(). - What runs: the monitor (root, PID 1); the compositor (
_swm); the monitor’s two sensor readers, hwmons and RAPL, and the batteries, each chrooted to/sysas the sensor uid with no capability, under no-new-privs and a kill-on-violation filter (lib/libsession/privsep.csense_cage()); the DHCP engine when dom0 takes its own lease; one swm-vmm per VM, the net VM, the gfx VM, the screen VM and ttvm; one vmm-gfx per VM; each container’s relay, reaper, application and D-Bus system bus; short-lived monitor workers. - What does not run: no getty, login manager, seatd, logind, udev, acpid or any network service. The power button is a compositor binding.
6.11 Time travel processes
| Step | Process | uid | Confinement |
|---|---|---|---|
| Point (reflink clone) | monitor child | root | descriptors closed |
| Copy to a place | monitor child | root | no-new-privs and a filter with no open, no exec, no executable mappings |
| Backup VM | swm-vmm | backup uid | the VMM sandbox (6.3) |
| swm-tt in ttvm | guest PID 1 | guest root | the place mounted nosuid, nodev, noexec |
| Anchor, rewrap, open, look, list | monitor children | root | look and list read as the session’s uid |
6.12 Installer
- Root: every command but
help,plan,survey,release sign,vm list,vm topandinstall --dry-runruns as root. Update commands are not dumpable. - Fixed execution: fork and exec from a fixed path with a fixed
PATHand an empty environment. Shell steps are fixed scripts with arguments passed as"$@".installer/execute.crun_cmd(). - Answer file: an allowlist validator for every field. Cleartext
passwords refused.
installer/answer.canswer_valid(). - Signatures before use: the boot image, the VM kernel index, and the new loader at update.
- Update jail: package updates run in new mount and PID namespaces
with reduced capabilities. The ESP is mounted read-only in a private
namespace for reading.
installer/upgrade.cadd_jail(). - One key holder: all install keys live in locked memory in one
process and go to cryptsetup through locked memfds.
installer/provision.cprovision().
6.13 byol VMs (swmtool vm)
byol only: dom0 has no qemu. These VMs are not sessions. They have no workspace, no swm-vmm sandbox and no signed kernel.
- Each VM its own ids (Marco, 2026-11-18): every VM’s qemu runs as
a uid of its own, its gid the same number: the first id of a line
-vm-<name>:<start>:65536in/etc/subuidand/etc/subgid, from the containers’ window,[2^30, 2^31), by their scan (no line of either file met, the same start in each, added to both under shadow’s locks). A name that starts with-is no user’s, sonewuidmapmaps it for no one. A line that meets another, or a range that holds a uid of/etc/passwdor a gid of/etc/group, is refused at each lookup. The VM’s disk, seed, UEFI vars and/run/vm/<name>are those ids’, 0600 (the seed 0400, the run directory 0700): one VM’s qemu, escaped, reads no other VM’s disk, QMP or console.createandclonemake the ids;rmspends them (-spent,rm -k’s kept disk too), never given again. qemu’s one other group is kvm, for/dev/kvm; the run sets groups, gid and uid and stops if it can become root again. A run directory of other ids is emptied before qemu starts.installer/vm_image.cvm_ids(),vm_ids_take();installer/ct_image.cct_range_new();installer/vm_range.cct_range();installer/vm.cvm_become(),vm_run(). - A VM from before its ids: its first start, or a clone of it, gives
it ids, then makes each file its YAML’s drives name in
/var/lib/scrotwmos/vmthat thevmuser owns (a regular file of one link, opened with no link followed) those ids’, mode its owner’s bits alone. A failure spends the new ids, and the next start begins again. Thevmuser (avmof uid 0 is refused) is looked up by name: an install makes none, and a box from before its ids keeps its own, which owns nothing else and runs no qemu. A disk the YAML names outside that directory is not moved: root gives it to the ids.installer/vm_image.cvm_ids_take(). - What qemu gets: the YAML’s options as written, plus the name, a
QMP socket, a console socket and
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny: qemu’s seccomp filter, so an escaped qemu cannot exec, fork a helper, gain privileges or change its scheduling. A bridge NIC’s tap is the run step’s (below), so qemu spawns no helper. The tool adds no namespace and no cgroup. A YAML that setsname,qmp,qmp-pretty,monitor,mon,daemonize,readconfig,gdb,s,qtest,incoming,S,run-withorsandbox, a value that startsmon:(a monitor on a chardev), or an idswm*, is refused. The list guards the tool’s own options and its hold on qemu; a VM’s YAML is root’s.installer/vm_conf.cvm_conf_parse(),vm_argv_make(). - Sockets: in
/run/vm/<name>, mode 0700, the VM’s ids’. Root’s swmtool connects to them with that VM’s file system ids and gid as its one group, so a symlink that qemu swaps in reaches only what that VM’s uid may reach. A VM still running from before its ids: thevmuser’s.installer/sv.csock_open();installer/vm.cvm_sock_ids(). - Service: runit runs root’s installed
/usr/local/bin/swmtool, never the path of the swmtool that laid the service.installer/vm.csv_lay(). - Disks: create runs qemu-img as the new VM’s ids; clone runs it as
the new VM’s uid in the source’s group, which reads the source’s
disk alone (made 0640 for the copy), then gives the copy to the new
VM’s gid. A disk header that names another file as its backing file
is read with those ids, never root’s. Clone copies the source’s UEFI
vars no larger than its image’s template, as qemu keeps them.
installer/vm_image.cvm_make(),clone_locked(),file_copy(). - Taps: a VM’s NIC on
lan0orvmnat0(netdev: bridge,...in its YAML) gets a tap the run step makes, as root, before it becomes the VM’s ids: namedswmqand its MAC’s last bytes, not persistent, with no owner, so no user but the holder of its fd can attach to it; a port of its bridge, IPv6 off; qemu gets the fd (tap,fd=N). Any other bridge is refused. qemu-bridge-helper is not used: byol writes no/etc/qemu/bridge.confline, and every install and update takes out theallow lan0andallow vmnat0an older install wrote, so no local user puts a tap in either bridge by the setuid helper.installer/vm.cvm_tap_make(),vm_taps_make();installer/vm_nic.cvm_taps();installer/fill.cbridge_unallow(). - Pins:
vmnatpins each guest’s port by its name, a VM’s tap as a container’s veth: onvmnat0its MAC, IPv4 and ARP its own; onlan0a VM’s tap its MAC alone, and no DHCP server’s, router’s advertisement or DHCPv6 server’s frame from it, so a guest gives the host’s dhcpcd no lease or route. A second YAML with an address or MAC taken is not pinned. The holder of a tap’s fd may set the tap’s MAC (SIOCSIFHWADDRon the fd, no cap needed); the bridge would then send it the frames for that MAC. The pins’ way out drops, out a VM’s tap, any unicast frame not to its guest’s MAC, and out any port a guest’s MAC but its own port’s;vmnatdeletes a VM’s tap whose MAC was set since it was made (addr_assign_type).lib/libsession/net_nat.cnet_nat_bridge_pin(),pin_out_rules(),pin_vtp_rules();installer/vmnat.ctap_sweep(). - vmnat0’s rules: laid before the bridge comes up, IPv4 forwarding
after them; a lay that fails takes
vmnat0down. The forwards are laid eight to a transaction, so the box’s 64 fit. A forward never takes the box’s own ports (TCP 22, TCP and UDP 53, UDP 67, 68, 123, 546, 547), whatever listens at the time.installer/vmnat.cvmnat_lay(),vmnat_fail();installer/vm_nic.cvm_fwd_reserved(). - lan0:
lan0holds the wired uplink’s NIC, so a VM there is a box on the LAN: scrotwmos forwards no ports to it and filters its traffic only by the pins above. A Wi-Fi uplink gets nolan0. Our/etc/sv/dhcpcd/lan0alone markslan0done: a root that has it is left as it is. Withlan0, dhcpcd runs onlan0and the real NICs; the NIC inlan0, the VMs’ taps, and a user’s bridge, tun or wg link get none.lan0follows its NIC’s carrier, so a VM’s tap does not keeplan0’s lease and default route with the cable out.lan0’sarp_acceptis 2: an unasked ARP makes an entry for an address of its subnet alone.vm list’s ip onlan0is that entry, the guest’s own word: it is not to be trusted.installer/fill.cfill_byol_lan0(),byol_dhcpcd_conf;installer/lan0_link.ccmd_lan0_link(). - Image builds:
swmtool vm image buildruns as root, but its work does not. Every build’s work runs as root of a user and a pid namespace of its own, with no new privileges: void’s packages’ scripts, dracut, grub-mkimage, sfdisk, mke2fs and qemu-img; fedora-45’s and openbsd-8.0’s fetches, installs and qemu. No VM’s uid builds: an escaped VM cannot touch a build, nor a build’s code a VM’s disk. That root is the first id of the build range,scrotwmos-buildin/etc/subuidand/etc/subgid, 65536 ids that are no account’s. swmtool writes the namespace’s maps itself, as host root. Before the build, it refuses a range that is missing, has fewer than 65536 ids, starts below 100000, reaches the fixed uids of sessions and their services (GFXVM_GFX_UID_BASEand up), meets another line of its file, or holds a uid of/etc/passwdor a gid of/etc/group. Only those local files are read: users and groups from LDAP or another NSS source are not checked. fedora-45 and openbsd-8.0 boot qemu under KVM: their gid maps also put the host’s kvm group,/etc/group’s, at gid 65536, past the range, and that is the work’s one group, as it is each VM’s qemu’s. A kvm group that is missing or of gid 0, root’s, and a box with no/dev/kvm(no kvm module, or nested virtualization off) are refused before anything is made. The uid map is the range alone. Landlock holds the work’s writes, device ioctls included from ABI 5, to its work directory and/dev/null, and for those two builds to/dev/kvm. The kvm group’s one other device on Void,/dev/udmabuf(0660), is then read at most; below ABI 5 a read-only descriptor on it still takes its ioctls./dev/vhost-netand/dev/vhost-vsockare kvm’s too but 0666 on Void: the group adds nothing there. From ABI 6 Landlock keeps the work from abstract unix sockets and from signalling processes outside it; a kernel without Landlock refuses the build. Every work runs in a session of its own, with no controlling tty. The work directory sits in a directory of root’s, mode 0700 (0710 shown: the group bits are the ACL’s mask), whose POSIX ACL lets the range’s first uid alone pass (–x); the work does not own it and cannot change it. The ACL and the work directory’s owner are set by that directory’s fd, no link followed: a--diranother user may write cannot turn root’s chown or ACL onto a file of its choice. A file the work makes setuid or setgid to its ids (the range, or kvm), in a work directory it makes 0755, is so out of every other user’s reach. A file system with no POSIX ACLs refuses the build. When the work exits, or its parent outside dies, the kernel kills what it left in its pid namespace. Root then takes the work directory back by its fd, follows no link in it, and seals the disk only when nothing has it open for writing, its qcow2 header names no backing file and sets no external data file (every VM of the image would read that file), and no image of that name is there: the rename never replaces one. byol’s fill lays the range at install and update, at the lowest free start in that window, a multiple of 65536, in both files or neither. A subid file it cannot read or refuses, or a full window, is said and both are left: install and update go on, and the build then refuses.installer/vm_range.cvm_range(),vm_become_range();installer/vm_deps.cvm_range_scan();installer/vm_image_fedora.cvmb_build(),vmb_gate();installer/vm_image.cvm_image_seal();installer/fill.crange_lay(). - Image build, fedora-45: curl fetches over HTTPS alone, TLS 1.2 or
newer. gpgv checks the release’s CHECKSUM against Fedora 45’s key,
baked into swmtool; the netinst’s sha256 must be both the CHECKSUM’s
and the recipe’s pin. The kernel, initrd, and stage2 must match
pinned sha256s. Any mismatch stops the build before qemu runs. The install’s
packages come by metalink with
gpgcheck=1against the same key and the installer’s own repos removed; the repo metadata is not signed (repo_gpgcheck=0). When swmtool runs as root, the fetches and the install run as the build range’s root, with kvm, in a work directory of its own; the image is root’s, 0444.installer/vm_image_fedora.cwork(),vmb_fetch(),vmb_build();installer/vm_recipe.cvmi_signed_sum(),vmi_pin(),vmi_ks(). - Image build, openbsd-8.0: SHA256.sig is checked in swmtool
against OpenBSD 8.0’s signify key, baked in; each of the ten files
fetched must match its sum there. Root’s password is locked. The prep
boot’s ssh uses a key made for the build, to a hostfwd port on
127.0.0.1, with no host key check; the key, that boot’s host keys,
and its random seed are taken out before the image is sealed. When
swmtool runs as root, the build range’s root does the work, with
kvm, as for fedora-45.
installer/vm_recipe_openbsd.cvmo_sums();installer/vm_image_openbsd.cvm_image_build_openbsd(). - Image serve: no port is opened on the box. qemu’s guestfwd runs
swmtool vm image servefor each connection the build’s guest makes to one address in its user-mode net (10.0.2.100:80 for fedora-45, 10.0.2.2:80 for openbsd-8.0). It reads one request in 10 s, serves a GET of a listed file alone (a symlink there is not followed), and answers anything else with 404.installer/vm_recipe.cvmi_serve(). - Password and seed:
createandclonemake a new password, 20 letters and digits from getrandom, or ask for one (-p). It is kept in/var/lib/scrotwmos/vm/<name>.pass, root’s, 0600;vm passprints it;rmwrites zeros over it before it unlinks it. The seed holds its bcrypt hash ($2b$, cost 12, a random salt), never the password, with the login user’s own key (~/.ssh/id_ed25519.pub, alone, never the user’sauthorized_keys: whoever may log in to the box is not whoever may log in to its VMs; none, and create refuses) and a random id. The key file is opened with no link followed and checked by its fd: the box user’s own regular file. The seed is the VM’s ids’, 0400, made under umask 077: no other user, nor another VM’s uid, reads the hash. The images’ sshd takes keys alone, never root; the password is the console’s and doas’s or sudo’s.installer/vm_image.cpass_new(),pass_hash(),seed_write(),shred().
6.14 byol containers (swmtool ct)
byol only. A container’s root is uid 0 of its own user namespace, over a range of ids no account has; the design and its limits are in doc/design-byol-containers.md.
Each run step its own ids: root’s container’s run step, after its root part, runs as a uid of its own, its gid the same number: the first id of a line
-ct-<name>:<start>:65536in/etc/subuidand/etc/subgid, made and checked as a VM’s ids are (6.13)./run/ct/<name>(pid, console, lease, the kill mark), 0700, and the cgroup’s delegated files are those ids’: one run step, broken into, reaches no other container’s console, pid file or cgroup.createandclonemake the ids;rmspends them (rm -k’s too), never given again. The run sets no groups, then its gid and uid, and stops if it can become root again. A run directory of other ids is emptied first. A container from before them takes them at its next start, said in its log; thectuser stays, the owner of what runs from before and of the users’lan0: dhcpkeepers in vmnat. The ids are no account’s, sonewuidmapmaps nothing for them: the mover, forked by the root part, its death the run’s from its first line, writes pid 1’s maps as root once its pid is checked (ct_pid1_open: a pidfd,ct_pid1_iswith the run’s own pid as the parent, the file, the pidfd’s signal 0; the range the root’s owner), as newuidmap would, then drops to the run’s ids for the NICs. A user’s container runs as the user, mapped by newuidmap.installer/ct.cct_user(),ct_run_ids();installer/ct_run.cct_run(),rundir_lay(),mover(),pid1_maps();installer/vm_deps.cct_pid1_open();installer/ct_image.crange_ids_new(),rm_locked().Root’s ranges no account’s: a root’s container’s range line is
-ct:<start>:65536, a name no account has, sonewuidmapmaps it for no one; root alone maps it (above). Act:line from before, thectuser’s, is moved to-ctin both files at once at the container’s next start, run, restart, enable, exec, clone or rm. After an update, restart every container (ct restart, or a reboot): till then an old run is thectuser’s, with no nonewprivs, and couldnewuidmapthe range of any container whose line is stillct’s, and reach every old run’s/run/ct.installer/ct_image.cct_wrap(),range_own().The id files’ size:
/etc/subuidand/etc/subgidare written whole, 64K at most (VM_SUBID_MAX): some 1400 root containers (two lines each), fewer with VMs and long names. Past it,createandcloneare refused and the files kept as they were: closed, no line dropped.installer/ct_image.csubid_end().No network caps: no container keeps
CAP_NET_ADMINorCAP_NET_RAW, a NIC or none: every exec drops both from its bounding set. pid 1, swmtool’s own code, sets the NICs before init: lo up, eacheth<n>its address and default route from the YAML (lan0’s key,vmnat0’s), IPv6 onlan0alone. No DHCP client runs in a container: onlan0: dhcpthe host runs the tree’s own client for it, a keeper the run’s ids’ withCAP_NET_ADMINalone in the container’s net namespace and the engine its own uid in an empty one, both in a cgroup the run’s end kills; a lease held tolan0’s rule, a refused one costing an address, never the keeper; the resolver a host file bound read-only, the root never written.installer/ct_run.ckeeper(). So no container changes a link, address, route, qdisc (tc) or filter, opens a raw or packet socket, or makes the kernel load a module for one.installer/ct_run.ccaps_drop(),net_lay(),eth_lay().The filter: the seccomp filter also refuses an nftables or xfrm netlink socket and the old tables’ writes, should a cap ever stay, and an AFALG or AFVSOCK socket, which any user namespace may open (vsock shares the host’s CID space); a denied argument is compared by its low word.
installer/ct_run.cct_filter().
7. Known limitations
These are not protected by the code today.
Boot and keys
- The appliance loader is not signed for UEFI Secure Boot, and nothing measures it. The tree verifies the dom0 image, but nothing verifies the loader that asks for the password. The protection of the loader file depends on the firmware setup, which the tree does not provide.
- On byol, the kernel, initrd and command line on the ESP are not signed. On a password boot, the disk key is given to the kernel and initrd found there. The TPM path is bound to PCR 8, but the password path is not.
- There is no anti-rollback at boot. The loader accepts any boot image the release key signed. The update check for an older release can be forced. The VM kernel index has no version.
- The keys.wrap header and slot metadata are not authenticated. A slot can be removed, or the file replaced by an older copy. The same holds for a byol TPM slot. The box keeps no counter.
- keys.wrap uses 16 bcrypt rounds. On byol, its slots use the same passphrase as the LUKS root, and are cheaper to test than the LUKS2 argon2id keyslot.
- The keymap file on the ESP is not sealed or signed. The compositor parses it.
- The VM kernel signing key has no TEST mark of its own at run time:
the launcher trusts whatever
kernel/keys/kernel.pubthe package carries. Only a TEST build,RELEASE_KEY=testor a check goal’s kernels, may carry the TEST kernel key. - Builds of install media default to the test keys. They warn at build time and on every boot, but they are not refused.
- The world master never changes. A password change rewraps it.
- Dictionary-attack protection is off for the TPM’s sealed object.
- The first TPM seal trusts the SRK the bus gives it; later unseals hold it to the pinned name.
Disk and data
- dm-crypt uses AES-XTS with no integrity. A change to ciphertext is not detected; it decrypts to random data in one block.
- Every world holds the same swmdata disk key, the decoy included. Any world can open swmdata and write to the store. It cannot read another world’s images, but it can change or replace them, or replace sealed store blobs with older copies of the same name.
- Image keys for roots, VM disks and the kernel store are derived from the master and the image label, with no salt. Re-creating an image under the same label reuses its key.
- A box installed before the swap’s key was made each boot keeps its old swap key sealed in the store under each A/B world and rescue. Nothing reads it, but with it a world’s master reads what the swap still holds from before, until the swap is written over.
- Deniability is limited. The slot count in keys.wrap is visible.
One keys.wrap per world is decided and deferred (ROADMAP.md). swmdata
and every image have a visible LUKS2 header. Container
/procand/sysshow the host’s device list. - The place header uses an empty username. A decoy password that equals a real world’s password also opens that world’s place and, through that world’s file, that world’s master.
- An old place header and the old password give the home key, for as long as that header exists. The home key never changes, so they also open the world’s file, and with it the master.
- The recovery phrase cannot be changed or revoked. It derives from the master, which never changes. Whoever has the phrase and the place has the world.
- A place can withhold the newest world’s file and give an older one.
swmtool place worldtakes the newest file that the place gives. No counter tells it more. - The copy to the ESP’s twin can fail after an update or a password change. Then the twin keeps the ESP as it was, with the old password’s slot, until the next change to the ESP copies it.
- A process that rewraps a place header after unlock does not wipe every copy of the password before it exits.
Isolation
- For a container whose root is an image, the root check that store
roots get is not run. The container’s
/devtmpfs is not mounted nodev. - Container applications may create user and network namespaces, for browser sandboxes. The dom0 kernel has user namespaces on, and no setting in the tree restricts them. This exposes kernel code that needs namespaced capabilities, such as tc. nfnetlink, and with it nf_tables, takes commands from the init user namespace alone, on every kernel the tree builds (kernel patch 0018). The dom0 kernel has no xtables and no xfrm netlink.
- Every render node present in dom0 is bound into each container, with no read-only, nosuid or noexec flag, and with all ioctls allowed.
- The libraries set no default limits: memory, pids and CPU limits exist only when the session config sets them. The appliance install writes a process limit (8192 unless the plan says otherwise) and a 4G memory limit for each container session. There is no open file limit for a plain VM.
- The compositor decides some security actions: ROM approvals, USB accept, turning points off or deleting all points, input settings, and the unlock decision. These need no password. A compromised compositor can do them.
- A void image build runs its packages’ code on the host’s network, with no seccomp filter and no cgroup. It reads what any user may read. It can connect to the unix socket files any user may, the system bus’s among them: Landlock holds no right over them. The packages are signed, but their scripts run in the build and can change the image they make: a trojaned image is in reach of any package the build installs.
- A ttvm started by swmtool in rescue runs with only a uid change and no-new-privs. It has no namespaces, no empty root, no application filter and no cgroup.
- The time-travel worker processes other than the copy child run as root with no seccomp filter.
- The virtual keyboard, virtual pointer, screencopy and input-method
protocols remain in dom0. Only
_swmand root reach the socket, and dom0 runs no clients. - vmm-gfx runs in dom0 and allows i915 command submission ioctls.
- VFIO maps a GPU’s BAR 0 whole, including NVIDIA’s config mirror.
- Debug switches that turn a seccomp filter into log-only exist as build or run-time flags. They are off by default, but no release rule refuses them.
- The test crash key in test builds has no warning of its own; it rides with the test key warnings.
Network
- IPv6 is turned off per interface. The IPv6 backstop drops forwarded IPv6 in from and out to a session port only. There is no rule for IPv6 to the router itself, or for IPv6 between interfaces that are not session ports.
- A resolver in a private range is accepted from DHCP. DNS traffic to it passes ahead of the LAN drop rules, so a session without LAN reach can reach that one host on port 53.
- On byol, a container gets its own network namespace and a routed /30 on a veth, with NAT and its reach, as a VM does. The byol compositor has no dom0 seccomp filter. The uplink closure is not applied on byol.
- On byol, a VM of
swmtool vmonlan0is on the LAN with no filter of scrotwmos’s. Its qemu has no sandbox but its user. - Time is not authenticated. NTP has no constraint checks. The net VM or the compositor can step dom0’s clock once per boot, within the limits in 6.1.
- Network backup places have no transport security. NFS uses no Kerberos and SMB uses no encryption. The place header and the SMB password cross the LAN. Deletion or withholding of copies by the place is not detected.
- The worlds’ own package repository is not signed. Void packages are checked by xbps with the repository keys copied from the build host.
USB and input
- Device stamps hash the descriptors a device reports, which a device can choose.
- If the monitor cannot turn USB authorization off, it warns and goes on.
- The boot window stays open until the compositor’s first check, and grows with each USB device added in it.
- On byol, input device descriptors are not revoked on a VT switch.