Skip to content

Every ESP and control disk is mounted as FAT and nothing else - #224

Merged
DevomB merged 1 commit into
mainfrom
mounts-name-vfat
Oct 5, 2026
Merged

DevomB merged 1 commit into
mainfrom
mounts-name-vfat

Conversation

@DevomB

@DevomB DevomB commented Oct 5, 2026

Copy link
Copy Markdown
Owner

The on-system tools find an ESP by its GPT name on the system's own disk and mounted it without naming a filesystem, so the kernel took whatever was there. Nothing ties the name kryptik-esp to the FAT partition the firmware boots from.

What that allows, to someone who can rewrite the disk or the stick while the machine is off:

  • A FAT partition under another name holds the signed kernel, so the machine boots as before. The partition named kryptik-esp is ext4 and holds links where the tools write: EFI/BOOT/BOOTX64.EFI.new, kryptik/committed-slot, the version files.
  • boot-success (every boot, after the state partition is unlocked), kryptik-update, kryptik-recover and kryptik-install then write through those links as root in zone 0. The bytes are the tools' own, not the attacker's, but the places are the attacker's: a file inside the encrypted state partition, or another disk of the machine. An attacker with the machine in hand can already wipe the disk; this let them pick files inside the encryption, and from an install medium reach a disk the person did not name.
  • Read-only mounts (the installer's look at the medium, the control disk before its signature is checked) hand an arbitrary filesystem image to the kernel's parser for no reason.

Found by reading; not reproduced on a machine.

The change: every such mount is mount -t vfat. FAT holds no links and no device nodes. The two mounts of a state partition the tool has just made or opened are named ext4 in the same pass, so no mount of a device in these tools leaves its filesystem to be guessed.

Files: boot-success.sh, installer-run.sh, testctl.sh, kryptik-install.sh, kryptik-update, kryptik-recover. The ISO's esp.img is still mounted through a loop device (-o ro,loop), now as vfat.

Tests: tools/tests/mount-types.sh fails on any mount in these tools that opens with its options, with a control that the pattern tells the two forms apart. tools/tests/boot-success.sh expects the typed commands. The install, update, integrity and boot suites exercise every one of these mounts on real media.

The hardware report (#180) had the same fault in its two new mounts, and one that needs no patience: its boot service writes with nobody at the keyboard. It is fixed on that branch.

…ther filesystem under the partition's label, a link at a name root writes would carry the write to a disk or a file of the machine
@DevomB
DevomB merged commit 6a5beb1 into main Oct 5, 2026
20 checks passed
@DevomB
DevomB deleted the mounts-name-vfat branch October 5, 2026 19:02
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