Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
592dc9a
feat: dedicated verity hash partitions, UUID-based boot, and trident …
bfjelds Jun 1, 2026
e3532d6
feat: move verity slot identity into PARTUUID-based UKI addons
bfjelds Jun 1, 2026
60d5a2d
fix: restore UUID validation, move mount.usr to main UKI, reject non-…
bfjelds Jun 5, 2026
15cd890
fix: harden jq lookups, validate JSON structure, improve temp cleanup
bfjelds Jun 5, 2026
531c25a
Re-enable SELinux policy minimization
bfjelds Jul 13, 2026
eae8f06
fix: address Copilot review feedback on A/B verity boot
bfjelds Jul 14, 2026
eb6df56
fix: write FS UUID in both verity modes; unify verity paths
bfjelds Jul 14, 2026
40a84b4
fix: raise InvalidLayout for missing verity_hash partition reference
bfjelds Jul 14, 2026
f5d2152
fix: drop unused 'count' local in _lookup_partuuid
bfjelds Jul 14, 2026
78d965c
fix: normalize verity_hash cross-reference to str before lookup
bfjelds Jul 14, 2026
b5ce937
Increase UKI ESP size from 128 MiB to 256 MiB
bfjelds Jul 19, 2026
5ea68d8
Merge pull request #32 from microsoft/user/bfjelds/uki-esp-size-incre…
bfjelds Jul 20, 2026
1e1728f
fix: address PR #28 review comments
bfjelds Jul 20, 2026
52df44f
Revert grub verity-hash die back to pre-existing warn
bfjelds Jul 20, 2026
7a83476
fix: drop jq -e in _lookup_partuuid so explicit null check runs
bfjelds Jul 20, 2026
57cb18f
uki: add arm64 test-image device-timeout addon
bfjelds Jul 21, 2026
728a1e0
Merge pull request #35 from microsoft/user/bfjelds/arm-kola-device-ti…
bfjelds Jul 22, 2026
960810d
Address review: harden UKI timeout addon + tridentd.socket enablement
bfjelds Jul 22, 2026
e08d31d
Address review: fail fast on empty verity_hash in disk_util Verity
bfjelds Jul 22, 2026
e41f296
Address review: guard ukify build under strict mode; genericize FS UU…
bfjelds Jul 22, 2026
5107846
Address review: use sudo rm -rf for ukify temp-dir cleanup
bfjelds Jul 22, 2026
f730598
acl-grub: use dedicated /usr verity hash partitions, consistent with UKI
Jul 23, 2026
bb73323
vm_image_util: extend device-init timeout to GRUB arm64 test images too
Jul 24, 2026
80b37d3
Merge pull request #36 from microsoft/user/bfjelds/acl-grub-hash-part…
bfjelds Jul 24, 2026
9063477
grub timeout override: fail if sed substitution does not take effect
bfjelds Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions acl/docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ ACL's primary boot path uses **systemd-boot** with **Unified Kernel Images (UKI)

The `/usr` partition (USR-A) is a read-only btrfs filesystem with zstd compression. **dm-verity** provides block-level integrity verification:

- The verity hash tree is appended to the USR partition data.
- At boot, `systemd-veritysetup` activates the verity device using kernel command-line parameters embedded in the UKI: `systemd.verity_usr_data`, `systemd.verity_usr_hash`, and `systemd.verity_usr_options=hash-offset=<N>,panic-on-corruption`.
- The verity hash tree is stored in a dedicated hash partition (HASH-A, immediately following USR-A on disk).
- At boot, `systemd-veritysetup` activates the verity device using slot-specific parameters delivered via a per-slot systemd-stub addon: `systemd.verity_usr_data=PARTUUID=<usr-data-partition>`, `systemd.verity_usr_hash=PARTUUID=<usr-hash-partition>`, and `systemd.verity_usr_options=panic-on-corruption`.
- The main UKI cmdline stays slot-independent (`mount.usr=/dev/mapper/usr`); Trident switches slots by swapping which addon is active in `<uki>.efi.extra.d/`, so the same signed UKI boots either A or B. (The secondary GRUB boot path instead builds the verity cmdline from filesystem/verity UUIDs, `UUID=<btrfs-uuid>` / `UUID=<verity-uuid>`.)
- Any corruption of `/usr` causes an immediate kernel panic, preventing the system from running a tampered image.

The A/B partition scheme (USR-A / USR-B) enables safe updates: the inactive slot is written, verified, and then atomically switched on reboot.
Expand Down
11 changes: 11 additions & 0 deletions build_library/build_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ EOF

"${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" --arch="${BOARD}" verity \
--root_hash="${BUILD_DIR}/${image_name%.bin}_verity.txt" \
--verity_uuid="${BUILD_DIR}/${image_name%.bin}_verity_uuid.txt" \
--fs_uuid="${BUILD_DIR}/${image_name%.bin}_fs_uuid.txt" \
"${BUILD_DIR}/${image_name}"

# Magic alert! Root hash injection works by writing the hash value to a
Expand Down Expand Up @@ -953,6 +955,15 @@ EOF
if [[ -f "${verity_hash_file}" ]]; then
bootloader_args+=(--verity_hash="${verity_hash_file}")
fi
# Pass UUID files for UUID-based cmdline construction
local verity_uuid_file="${BUILD_DIR}/${image_name%.bin}_verity_uuid.txt"
if [[ -f "${verity_uuid_file}" ]]; then
bootloader_args+=(--verity_uuid="${verity_uuid_file}")
fi
Comment thread
bfjelds marked this conversation as resolved.
local fs_uuid_file="${BUILD_DIR}/${image_name%.bin}_fs_uuid.txt"
if [[ -f "${fs_uuid_file}" ]]; then
bootloader_args+=(--fs_uuid="${fs_uuid_file}")
fi
fi
else
bootloader_args+=(--noverity)
Expand Down
42 changes: 31 additions & 11 deletions build_library/disk_layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,36 @@
"fs_type":"btrfs",
"fs_compression":"zstd",
"mount":"/usr",
"verity_hash":"4",
"features": ["prioritize", "verity"]
},
"4":{
"label":"HASH-A",
"uuid":"1fae528b-6baf-4efc-a226-2a23f9291ce6",
"type":"dps-usr-verity",
"blocks":"20480"
},
"5":{
"label":"USR-B",
"uuid":"e03dd35c-7c2d-4a47-b3fe-27f15780a57c",
"type":"flatcar-rootfs",
"blocks":"2097152",
"fs_blocks":"262144"
"fs_blocks":"262144",
"verity_hash":"6"
},
"5":{
"6":{
"label":"HASH-B",
"uuid":"accb60b1-1d72-4e05-9363-6fd51e2ce788",
"type":"dps-usr-verity",
"blocks":"20480"
},
"7":{
"label":"ROOT-C",
"uuid":"d82521b4-07ac-4f1c-8840-ddefedc332f3",
"type":"blank",
"blocks":"0"
},
"6":{
"8":{
"label":"OEM",
"fs_label":"OEM",
"type":"data",
Expand All @@ -56,17 +70,17 @@
"fs_compression":"zlib",
"mount":"/oem"
},
"7":{
"9":{
"label":"OEM-CONFIG",
"type":"flatcar-reserved",
"blocks":"131072"
},
"8":{
"10":{
"type":"blank",
"label":"flatcar-reserved",
"blocks":"0"
},
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"type":"dps-root",
Expand All @@ -76,28 +90,28 @@
}
},
"vm":{
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"blocks":"12943360"
}
},
"azure":{
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"blocks":"58875904"
}
},
"vagrant":{
"9":{
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"blocks":"33845248"
}
},
"onmetal":{
"7":{
"9":{
"label":"config-2",
"fs_label":"config-2",
"type":"data",
Expand Down Expand Up @@ -130,11 +144,17 @@
"type":"blank"
},
"9":{
"type":"blank"
},
"10":{
"type":"blank"
},
"11":{
"label":"ROOT",
"fs_label":"ROOT",
"type":"0fc63daf-8483-4772-8e79-3d69d8477de4",
"blocks":"12582912"
}
}
}
}
}
36 changes: 28 additions & 8 deletions build_library/disk_layout_uki.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"label": "EFI-SYSTEM",
"fs_label": "EFI-SYSTEM",
"type": "efi",
"blocks": "262144",
"blocks": "524288",
"fs_type": "vfat",
"mount": "/boot",
"features": []
Expand All @@ -23,23 +23,37 @@
"uuid": "7130c94a-213a-4e5a-8e26-6cce9662f132",
"type": "flatcar-rootfs",
"blocks": "2097152",
"fs_blocks": "260094",
"fs_blocks": "262144",
"fs_type": "btrfs",
"fs_compression": "zstd",
"mount": "/usr",
"verity_hash": "3",
"features": [
"prioritize",
"verity"
]
},
"3": {
"label": "HASH-A",
"uuid": "b736baf1-cdb4-4535-beba-ddaaa30ad7b7",
"type": "dps-usr-verity",
"blocks": "20480"
},
"4": {
"label": "USR-B",
"uuid": "e03dd35c-7c2d-4a47-b3fe-27f15780a57c",
"type": "flatcar-rootfs",
"blocks": "2097152",
"fs_blocks": "262144"
"fs_blocks": "262144",
"verity_hash": "5"
},
"4": {
"5": {
"label": "HASH-B",
"uuid": "35bdf78b-c453-4661-98e6-f834f534ef5b",
"type": "dps-usr-verity",
"blocks": "20480"
},
"6": {
"label": "OEM",
"fs_label": "OEM",
"type": "data",
Expand All @@ -48,7 +62,7 @@
"fs_compression": "zlib",
"mount": "/oem"
},
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"type": "dps-root",
Expand All @@ -58,21 +72,21 @@
}
},
"vm": {
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"blocks": "12943360"
}
},
"azure": {
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"blocks": "58875904"
}
},
"vagrant": {
"5": {
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"blocks": "33845248"
Expand All @@ -92,6 +106,12 @@
"type": "blank"
},
"5": {
"type": "blank"
},
"6": {
"type": "blank"
},
"7": {
"label": "ROOT",
"fs_label": "ROOT",
"type": "0fc63daf-8483-4772-8e79-3d69d8477de4",
Expand Down
Loading
Loading