You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vtpm: Add runtime re-seal hook and NV-block persistence
Adds a runtime re-seal path that fires on a successful guest
TPM2_Shutdown (cmdCode 0x145, rc=0) and the supporting Tier-2
NV-block extraction needed to round-trip the simulator's persistent
state across a cold boot.
* libtcgtpm: expose get_nv_blob() / apply_nv_blob() accessors so
the in-process TPM Reference Implementation's 16 KiB NV image
(STATE_NV_BACKUP_SIZE) can be captured at re-seal time and
replayed on Recover. The bulk serialization wrapper grows a new
tagged section (0x12) that carries the NV blob alongside the
existing gp/gc/gr globals.
* vtpm::reseal: new module hosting trigger_if_shutdown() and
do_reseal(). The hook is invoked from TcgTpm::send_tpm_command
*outside* the VTPM SpinLock — re-seal talks to the TPM endpoint
through a separate TpmProxy<VsockTransport> and reads internal
state through the libtcgtpm C FFI, so it never re-acquires VTPM.
Re-seal failures are logged but never propagated to the guest;
fail-closed enforcement remains on the next cold-boot unseal
path (NV-counter check + AES-GCM tag verify).
* vtpm::mod / svsm: wire the optional vtpm-persist feature so the
TPM endpoint and host blob store can be reached over VSOCK
during cold-boot Provision/Recover and runtime re-seal. The
persistence path is opt-in and never silently falls back to
ephemeral — an unreachable endpoint is a hard error so the
security model that treats the physical TPM as a separate root
of trust cannot be downgraded by a channel-only attacker.
* cpu::apic / sev::snp_apic: convert the previously panicking
icr_write() to a logged warning so a transient HV write error
on the persistence path does not crash the boot CPU.
Signed-off-by: Goodleon-Y <goodleon3@126.com>
0 commit comments