Repository navigation
WIP: crash_log: Dump encrypted log on panic - #1711
Draft
Femi Adeyemi (femiatl) wants to merge 1 commit into
Draft
Femi Adeyemi (femiatl) wants to merge 1 commit into
Femi Adeyemi (femiatl) wants to merge 1 commit into
Conversation
Femi Adeyemi (femiatl)
force-pushed
the
femia/wip/crashlog
branch
4 times, most recently
from
October 23, 2026 23:37
578f890 to
b8df8aa
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved provisioning, log retention, serialization, key-trust, and panic-coordination issues prevent reliable and secure crash dumping.
8 open issues
Advance ring buffer head only for overwritten bytes · New Park concurrent panics during crash dump collection · New Remove duplicate crash dump key ID · New Reject dump key provisioning after boot trust window · New Route SetCrashDumpKey dispatch to the gate method · New Include panic information in encrypted crash artifact · New Preserve formatted prefix for oversized records · New Use the CRNG-produced seed for dump key generation · New
What changed in this PR
This PR introduces encrypted crash logging for LVBS, keeping logs in VTL1 memory and preparing an encrypted envelope for export to VTL0 on panic.
Changes:
- Replaces the host logger with a fixed-size crash logger and optional debug serial mirroring.
- Adds crash-dump key provisioning interfaces and RSA-wrapped AES-256-GCM encryption.
- Connects panic handling to dump generation and updates dependencies and global-count limits.
| File | Description |
|---|---|
litebox_runner_lvbs/src/main.rs |
Installs the crash logger and configures serial mirroring. |
litebox_runner_lvbs/src/lib.rs |
Adds the dispatch arm and invokes dumping on panic. |
litebox_platform_lvbs/src/mshv/vsm.rs |
Implements public-key loading and envelope preparation. |
litebox_platform_lvbs/src/mshv/ringbuffer.rs |
Adds a TODO about buffer alignment requirements. |
litebox_platform_lvbs/src/lib.rs |
Exposes the crash-log module. |
litebox_platform_lvbs/src/host/lvbs_impl.rs |
Makes the hardware seed helper crate-visible. |
litebox_platform_lvbs/src/crash_log.rs |
Implements buffered logging, encryption, and dump serialization. |
litebox_platform_lvbs/src/arch/x86/ioport.rs |
Removes ring-buffer forwarding and adds nonblocking panic serial output. |
litebox_platform_lvbs/Cargo.toml |
Adds logging and encryption dependencies. |
litebox_common_lvbs/src/lib.rs |
Defines the crash-key call, gate method, and error. |
dev_tests/src/ratchet.rs |
Adjusts global-count limits for logger relocation. |
Cargo.lock |
Records the added cryptographic dependency graph. |
Review effort: Balanced
Femi Adeyemi (femiatl)
force-pushed
the
femia/wip/crashlog
branch
from
November 4, 2026 16:16
b8df8aa to
dda7743
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can make crash logging fail or hang, retain an unsafe buffer registration, and panic during key setup, while a missing fixture prevents test compilation.
4 open issues
8 resolved since last review
Route SetCrashDumpKey dispatch to the gate method Reject dump key provisioning after boot trust window Remove duplicate crash dump key ID Park concurrent panics during crash dump collection Advance ring buffer head only for overwritten bytes Use the CRNG-produced seed for dump key generation Preserve formatted prefix for oversized records Include panic information in encrypted crash artifact
Review effort: Balanced
Femi Adeyemi (femiatl)
force-pushed
the
femia/wip/crashlog
branch
5 times, most recently
from
November 5, 2026 23:09
ff955ac to
19b78ed
Compare
Replace HOST_LOGGER with CRASH_LOGGER. It logs to VTL1 allocated memory and mirrors to the serial port, only dumping to the VTL0 ringbuffer on a panic. It replaces HOST_LOGGER writing to serial port and the VTL0 ringbuffer. VTL0 can use the SetCrashDumpKey API to send LiteBox a public RSA key for crash dump envelope encryption. Keys are not verified, so this API must be called before EndofBoot flag is set. Only DER encoded RSA-(2048,3072,4096 bit) keys in SPKI or PKCS#1 format are supported. When a crash dump key is set, release builds will turn serial port mirroring off. On panic, if a crash dump key is found, VTL1 logs are encrypted in-place with a symmetric (AES-256-GCM) key and that key is wrapped by the public RSA key. The optionally encrypted logs are copied to VTL0 in the format: CrashDumpHeader | Wrapped Key | (Cipher)Text | Tag Signed-off-by: Femi Adeyemi <femiadeyemi@microsoft.com>
Femi Adeyemi (femiatl)
force-pushed
the
femia/wip/crashlog
branch
from
November 10, 2026 11:41
19b78ed to
9dd406d
Compare
|
🤖 SemverChecks 🤖 Click for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Replace HOST_LOGGER with CRASH_LOGGER. It logs to VTL1 allocated
memory and mirrors to the serial port, only dumping to the VTL0
ringbuffer on a panic. This replaces HOST_LOGGER writing to serial
port and the VTL0 ringbugffer. When a crash dump key is set,
release builds will turn serial mirroring off.
VTL0 uses a new SetCrashDumpKey API to send LiteBox a public key
for crash dump envelope encryption. Key verification is a TODO, so
this API must be called before EndofBoot flag is set. Only DER
encoded RSA-(2048,3072,4096 bit) keys are supported.
On panic, VTL1 logs are encrypted in place with a symmetric key
(AES-256-GCM), and that key is wrapped by the public key sent
via SetCrashDumpKey API. The crash dump envelope is then written to
VTL0 ringbuffer in the following format:
CrashDumpHeader | Wrapped Key | Log Ciphertext | Tag
The panic path uses locks with bounded wait times and avoids
allocation. Writes to VTL0 wingbuffer are the exception. TODOs have
been added to simplify that path.
Signed-off-by: Femi Adeyemi femiadeyemi@microsoft.com