feat: sealed memory early init + verify - UTSM-E01..E04 very-early panic
- NEW core/sealed.c: utsm_sealed_early_init() runs right after utsm_init:
empty .sealed section -> UTSM-E01 panic; no root key -> UTSM-E02;
establishes BLAKE2b(root_key) MAC over [__sealed_start,__sealed_end).
- utsm_sealed_verify(): MAC mismatch -> UTSM-E03; verify-before-init ->
UTSM-E04. Wired into utsm_selftest (U3+ step).
- .sealed region now non-empty by construction: sealed brand record
"DESHAB-SEALED-MEMORY-V1-DEAICUP" lives in section(".sealed").
- Before this commit nothing ever referenced __sealed_start/__sealed_end:
the sealed section was never registered, MACed or verified.
- QEMU verify: [SEAL] region=0x20 bytes, MAC established, selftest OK,
boot reaches wizard, zero spurious panics.
[STUB] P0/UTSM/core/sealed.c | 剩余STUB命中=101(违规=0) | “封缄即落款,空区即自爆” | 已提交=<this>
This commit is contained in:
@@ -100,6 +100,13 @@ int utsm_selftest_run(void) {
|
||||
return UTSM_ERR_INVALID;
|
||||
}
|
||||
log_info("[UTSM] selftest page MAC determinism ok");
|
||||
|
||||
/* ==== U3+: 封缄内存 .sealed 区 MAC 校验(UTSM-E03 路径自证) ==== */
|
||||
{
|
||||
extern void utsm_sealed_verify(void);
|
||||
utsm_sealed_verify(); /* 不符即 panic,返回即通过 */
|
||||
log_info("[UTSM] selftest sealed MAC verify ok");
|
||||
}
|
||||
}
|
||||
|
||||
/* ==== U4: 密文页 dump —— 串口输出密文/明文 hex 对照 ==== */
|
||||
|
||||
Reference in New Issue
Block a user