Skip to content

Fast forward with closed source changes on Vmbfs checks and pre-mem bump changes#80

Open
maheeraeron wants to merge 2 commits into
microsoft:mainfrom
maheeraeron:user/maheeraeron/ff
Open

Fast forward with closed source changes on Vmbfs checks and pre-mem bump changes#80
maheeraeron wants to merge 2 commits into
microsoft:mainfrom
maheeraeron:user/maheeraeron/ff

Conversation

@maheeraeron
Copy link
Copy Markdown
Collaborator

This PR fast forwards with closed source changes on Vmbfs checks and increasing the PEI pre-mem buffer for the advanced logger

Mike Ebersol and others added 2 commits May 24, 2026 21:22
…responses

[Copilot] Harden VmbfsDxe against malicious host responses

Remove VMBFS_BAD_HOST macro (was ASSERT(FALSE), no-op in release) and
replace all call sites with FAIL_FAST_UNEXPECTED_HOST_BEHAVIOR().
Remove dead code after each FAIL_FAST (status assignments, goto Cleanup,
buffer clamping) since FAIL_FAST terminates the system.

Hardened checks: version response size/type, file info response size/type,
read payload response size/type, response byte count exceeding request,
and oversized receive callback packets.

----
Security hardening: enforce fail-fast behavior and stricter validation to defend VmbfsDxe against malicious/unexpected host responses.

Strengthens VmbfsDxe’s handling of incorrect/hostile VMBFS messages by replacing recoverable error paths with fail-fast crashes and tightening message buffer handling.
- `MsvmPkg/VmbfsDxe/VmbfsEfi.h`: remove `VMBFS_BAD_HOST` macro and add `CrashLib` include to support fail-fast behavior.
- `MsvmPkg/VmbfsDxe/Vmbfs.c`: fail fast on invalid version response messages; zero-initialize the packet buffer before use.
- `MsvmPkg/VmbfsDxe/VmbfsFile.c`: replace multiple “bad host” error/cleanup paths with `FAIL_FAST_UNEXPECTED_HOST_BEHAVIOR()` for malformed responses, size mismatches, and oversize buffer lengths.
- `MsvmPkg/VmbfsDxe/VmbfsDxe.inf`: add `CrashLib` dependency to wire in the new fail-fast mechanism.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #61642528
…pre-mem pages

Failures in PEI may not contain enough logs, so bump the pre-mem pages in the advanced logger. Additionally, use DEBUG_INFO for mmio information.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix to improve MMIO configuration logging and increase pre-memory logger buffer size to address ARM64 UEFI MMU configuration failures.

#### PR Summary
This pull request enhances debugging capabilities for MMIO configuration issues in ARM64 UEFI by promoting log levels from DEBUG_VERBOSE to DEBUG_INFO and increasing the pre-memory logger buffer size to capture more boot-time diagnostics.

- `Config.c`: Added DEBUG_INFO logging for resolved MMIO PCDs (LowGap and HighGap base/size) in bytes to make host-supplied MMIO layout visible in EfiDiagnostics ETW
- `Config.c`: Bumped MMIO ranges debug output from DEBUG_VERBOSE to DEBUG_INFO for better visibility
- `Mmu.c`: Changed ConfigureMmu debug log level from DEBUG_VERBOSE to DEBUG_INFO
- `MsvmPkgAARCH64.dsc` and `MsvmPkgX64.dsc`: Increased PcdAdvancedLoggerPreMemPages from 1 (4KB) to 8 (32KB) to accommodate additional logging
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Related work items: #48431797, #62345035
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