patina-v20.1.0
What's Changed
-
patina\_debugger: Cleanup features and feature usage @cfernald (#1372)
Change Details
## Description
This commit addresses two issues with the patina_debugger features:
-
Removes the
windbg_workaroundsfeature. Windbg is the primary supported scenario for patina_debugger, and these workaround do not inhibit other debuggers from working. Removing the feature reduces complexity and removes the ability for users to accidentally break windbg support. -
Removes the default features from patina_debugger for the workspace crate. This allows the features to be enabled for the appropriate core and by end platforms if applicable.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Regression tested with windbg on Q35
Integration Instructions
N/A
-
-
sdk/patina: Fix stack access violation in GuidHob test helpers @makubacki (#1363)
Change Details
## Description
gen_guid_hob()returned a(GuidHob, Box<[u8]>)tuple where the struct lived on the stack and the data lived on the heap (not contiguous in memory).Then,
HobTrait::size()forGuidHobreturnsheader.length(struct size + data size) whileas_ptr()returns the struct's start address. Any code callingfrom_raw_parts(as_ptr(), size())would read past the end of the stack-allocated struct into adjacent stack memory.This change fixes this by modifying
gen_guid_hob()to return aVec<u8>containing theGuidHobstruct bytes followed by the data bytes in a single contiguous heap allocation. This matches normal firmware memory layout where GUID HOB data immediately follows the header. A newguid_hob_refs()helper extracts typed(&GuidHob, &[u8])references from the contiguous buffer.- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all
Integration Instructions
- N/A - Only impacts module's unit tests
-
debug\_image\_info\_table: Use global test lock in tests @makubacki (#1361)
Change Details
## Description
Wraps unit tests in
with_locked_state()to follow the same pattern used by other patina_dxe_core test modules.This is done to ensure consistent test isolation under the global test lock and prevent potential non-deterministic failures if these tests or parallel tests are later extended to interact with global state.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all
Integration Instructions
- N/A - Only impacts module unit tests
-
StackTrace: AArch64: Add Frame pointer based stack trace support for GCC compiled PE binaries @vineelko (#1317)
Change Details
## Description
Dumps the stack trace by walking the FP/LR registers, without relying on unwind information. This is an AArch64-only fallback mechanism.
For GCC built PE images, .pdata/.xdata sections are not generated, causing stack trace dumping to fail. In this case, we attempt to dump the stack trace using an FP/LR register walk with the following limitations:
-
Patina binaries produced with LLVM almost always do not save FP/LR register pairs as part of the function prologue for non-leaf functions, even though the ABI mandates it. https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#646the-frame-pointer
-
Forcing this with the
-C force-frame-pointers=yescompiler flag can produce strange results. In some cases, instead of saving fp/lr usingstp x29, x30, [sp, #16]!, it saves lr/fp usingstp x30, x29, [sp, #16]!, completely breaking the stack walk. https://godbolt.org/z/7s9fG9vWe -
Due to the above reasons, the stack walk cannot be reliably terminated.
The only reason this is being introduced is to identify the driver/app causing the exception. For example, a Shell app built with GCC that triggers an assertion can still produce a reasonable stack trace.
Dumping stack trace with PC: 000001007AB72ED0, SP: 0000010078885D50, FP: 0000010078885D50 # Child-SP Return Address Call Site 0 0000010078885D50 000001007AB12770 Shell+66ED0 1 0000010078885E90 0000010007B98DCC Shell+6770 2 0000010078885FF0 0000010007B98E54 qemu_sbsa_dxe_core+18DCC 3 0000010007FFF4C0 0000010007B98F48 qemu_sbsa_dxe_core+18E54 4 0000010007FFF800 000001007AF54D08 qemu_sbsa_dxe_core+18F48 5 0000010007FFFA90 0000010007BAC388 BdsDxe+8D08 6 0000010007FFFF80 0000000010008878 qemu_sbsa_dxe_core+2C388 --. | 0:000> u qemu_sbsa_dxe_core!patina_dxe_core::call_bds | 00000000`1002c1b0 f81f0ff3 str x19,[sp,#-0x10]! | 00000000`1002c1b4 f90007fe str lr,[sp,#8] <---------------------------' 00000000`1002c1b8 d10183ff sub sp,sp,#0x60 The FP is not saved, so the return address in frame #6 is garbage.Symbol to source file resolution(Resolving frame 2): Since some modules in the stack trace are built with GCC and do not generate PDB files, their symbols must be resolved manually as shown below.
$ addr2line -e Shell.debug -f -C 0x6770 UefiMain ~/repos/patina-qemu/MU_BASECORE/ShellPkg/Application/Shell/Shell.c:372 371: ASSERT (FALSE); > 372: Status = gST->ConOut->ClearScreen (gST->ConOut); 373: if (EFI_ERROR (Status)) { 374: return (Status); 375: }
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Validated on SBSA Q35.
Integration Instructions
The change is already hooked into the exception handler for AArch64.
-
-
Add call to set\_handle to add the DXE core image handle to component storage. @joschock (#1359)
Change Details
## Description
Add call to set_handle to add the DXE core image handle to component storage.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Observed that a test component with a
params::Handleargument on the entry point now dispatches as expected (without this change, it did not).Integration Instructions
N/A
-
Add QEMU validation pending notification workflow @makubacki (#1357)
Change Details
## Description
Add a workflow that posts a "pending" comment on PRs immediately when pushed, indicating QEMU validation is waiting for CI to complete.
This prevents prior stale results from sitting around while CI runs and lets users know QEMU validation will happen soon if the workflow has not previously been run on the PR.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Verify comment is posted/updated as expected on fork (with a PR from another fork)
Integration Instructions
- N/A
-
debug\_image\_info\_table: Only update capacity after successful allocation @makubacki (#1356)
Change Details
## Description
grow()updatedself.capacitybefore verifying allocation success. Ifalloc_zeroed()orrealloc()returned null, the struct invariants were violated since capacity indicated space that was never allocated.If that happened,
impl Drop for DebugImageInfoDatawould then callalloc::alloc::dealloc()with an incorrect layout against a null or stale pointer, resulting in undefined behavior.This change:
- Defers the
capacityupdate until after the allocation result is confirmed to be non-null. - Adds an explicit null pointer check on the allocation results.
- Introduces a new
GrowErrorenum type to distinguishLayoutErrorfrom allocation failures. - Makes
DEFAULT_CAPACITYless brittle in unit tests
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all
Integration Instructions
- N/A
- Defers the
-
[REBASE \& FF] Minor cosmetic code hygiene cleanup/fixups @vineelko (#1354)
Change Details
## Description
- Clean up line/file endings and other trivial code hygiene with https://prek.j178.dev/cli/#prek
trim trailing whitespace.................................................Passed check for added large files..............................................Passed check for case conflicts.................................................Passed fix end of files.........................................................Passed fix utf-8 byte order marker..............................................Passed check json...........................................(no files to check)Skipped check json5..........................................(no files to check)Skipped check toml...............................................................Passed check yaml...........................................(no files to check)Skipped check xml................................................................Passed mixed line ending........................................................Passed check for broken symlinks............................(no files to check)Skipped check for merge conflicts................................................Passed detect private key.......................................................Passed check that executables have shebangs.....................................Passed- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Verified mdbook functionality locally.
Integration Instructions
NA
-
Move to upstream corosensei to allow deprecation of uefi-corosensei @joschock (#1352)
Change Details
## Description
Switches corosensei to the upstream corosensei which now has support for the uefi targets. This will allow deprecation of the previous uefi_corosensei fork.
Closes #1275
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Booted to OS on AARCH64 hardware. start_image and exit (primary consumers of corosensei) execute as expected.
Integration Instructions
N/A
-
.github/patina-qemu-pr-validation.yml: Skip when a PR is merged @makubacki (#1350)
Change Details
## Description
The case when a PR branch is not found was considered a failure in the API to find the PR. However, this will also happen when is merged and the CI workflow runs. In either case, treat this as a "skip" instead of an "error".
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Run with PR branch still available
- Run with PR branch deleted
Integration Instructions
- N/A
-
Improve panic handling @berlin-with0ut-return (#1264)
Change Details
## Description Addresses https://github.com//issues/1233.
This PR improves panic handling and logging for error cases. Some panics have been converted to errors, while others have simply been improved in clarity.
- Impacts functionality? -> instead of panic in some cases, returned error.
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make allIntegration Instructions
I would consider this more of a first pass. There may have been some panics that I missed, and possibly some panics that have been kept that would be better as Result/Options.
-
Add Patina QEMU PR Validation [Rebase \& FF] @makubacki (#1339)
Change Details
## Description
Two commits to add Patina QEMU testing on PRs in this repository.
See OpenDevicePartnership/patina-devops#81 for more details about the workflows themselves.
.github: And Patina QEMU validation workflows
Adds:
.github/workflows/patina-qemu-pr-validation.yml: Validates the
patina PR changes on QEMU..github/workflows/patina-qemu-pr-validation-post.yml: Posts the
results from the QEMU run back to the patina PR.
Temporarily sets the patina-devops branch to
patina_e2e_plat_validation
in OpenDevicePartnership/patina-devops during a "rollout" phase of the
new workflow so any adjustments can be quickly made. Once the workflow
is stable, workflows in the patina-devops release will be referenced
instead.
.github/ci-workflow.yml: Prevent concurrent runs
Create a concurrency group to enforce only a single CI workflow is run
per PR at a time.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Various PR scenarios on fork:
- Successful run
- Compilation failure
- Boot failure
- Cancellation of workflow due to a new PR push
- Log artifacts uploaded successfully
- Creation of comment in a new PR
- Amendment of comments in an existing PR
Integration Instructions
- N/A - Only used for CI in this repo
-
Cargo.toml: Drop Profiles @os-d (#1346)
Change Details
## Description
Now that profiles are in config.toml, drop them from Cargo.toml.
This commit was intended as part of the repo file sync, but I made a mistake and it wasn't included. I checked the other repos, they all correctly have this commit.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Tested with other RFC 25 changes.
Integration Instructions
N/A.
🚀 Features & ✨ Enhancements
-
Makefile.toml: Add test-asan task for AddressSanitizer testing @makubacki (#1368)
Change Details
## Description
Adds a
test-asantask that runs tests with AddressSanitizer (-Zsanitizer=address) enabled. The task supports Windows x64 and Linux hosts.Full task command:
cargo make test-asanOn Windows [1], ASan-instrumented binaries require the MSVC ASan runtime DLL (
clang_rt.asan_dynamic-x86_64.dll) to be on PATH at runtime so that's done as part of the task setup. The DLL location is resolved using the VC toolset installation path fromvswhere[2].On Linux, no additional setup is needed as the ASan runtime is resolved automatically by the linker.
[1] https://learn.microsoft.com/cpp/sanitizers/asan
[2] https://github.com/microsoft/vswhere/wiki/Find-VCA
--print-dll-pathargument is supported on Windows to print the resolved ASan DLL path and exit, which can be useful for adding that to the system PATH when running tests outside ofcargo make.
Note: I've already fixed an initial set of issues other than (mostly intentional) memory leaks. I can add this to CI in a follow up PR if there is interest in doing so. This PR is to raise awareness in the patina repo about the change. It will be added to Makefile.toml in patina-devops as well, if accepted.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make test-asanon Windows (with Visual Studio installed) and Ubuntu 24.04
Integration Instructions
- N/A - New task available
🐛 Bug Fixes
-
patina\_acpi: Unit test stability fixes [Rebase \& FF] @makubacki (#1365)
Change Details
## Description
Fixes two issues that impact stability of host-based unit tests in
patina_acpi.
patina_acpi: Prevent cloning invalid buffers
Various places in the
acpimodule use this pattern check a table's signature or read it length from a raw pointer.if (unsafe { (*xsdt_header).clone() }).signature != signature::XSDT {AcpiTableHeaderis defined as:pub struct AcpiTableHeader { pub signature: u32, pub length: u32, pub revision: u8, pub checksum: u8, pub oem_id: [u8; 6], pub oem_table_id: [u8; 8], pub oem_revision: u32, pub creator_id: u32, pub creator_revision: u32, }
Which is 36 bytes in size. The issue is that some tests like
mock_rsdp()intentionally create tables with invalid length fields that are less than 36 bytes. For example, this is backed by 35 bytes:StandardAcpiProvider::<MockBootServices>::get_xsdt_address_from_rsdp(mock_rsdp( signature::ACPI_RSDP_TABLE, true, ACPI_HEADER_LEN - 1, signature::XSDT, ))
This resulted in
.clone()reading 36 bytes from a 35 byte buffer.This is fixed by replacing those
(*ptr).clone()onAcpiTableHeadercalls with targetedread_signature_from_ptr()andread_length_from_ptr()helpers that read only the needed 4-byte field.Also ,
mock_rsdp()is updated to always allocate at leastACPI_HEADER_LENbytes for the XSDT buffer, decoupling the allocation size from the (possibly invalid) length field value under test.
patina_acpi: Fix stack buffer access in ACPI tests
A few tests in the module created ACPI table structs on the stack like:
let header1 = AcpiTableHeader { signature: 0x10, length: 101, ..Default::default() }; let table1 = unsafe { AcpiTable::new(header1, ...).unwrap() };
Note that
AcpiTableHeaderis actually 36 bytes, but thelengthfield (for testing) claimed 101 bytes. Eventaully, this code is executed:// Copy entire table into the new allocation. // SAFETY: If function preconditions are met, the pointer is valid and points to a valid ACPI table header. // SAFETY: If function preconditions are met, the table length is guaranteed to be correct. // SAFETY: If allocation succeeds, the destination is valid for writes of `table_length` bytes. unsafe { ptr::copy_nonoverlapping(header_ptr as *const u8, dest_alloc, table_length); }
Now, a copy is being made of 101 bytes from a 36-byte stack variable.
This change prevents this by updating
AcpiTable::new<T>()to require that the headerlengthfield exactly matches the size of the structT. The size check is made beforeTable::new()is called.Tables with variable-length data should use
AcpiTable::new_from_ptr()instead, where the caller guarantees that the table length is correct.Also updates a test in service.rs that created an
AcpiFadtto use the struct size for the table length.A test was not found that checks the
AcpiTable::new_from_ptr()case where thelengthexceeds the struct size, so code for that was added totest_new_from_ptr_creates_valid_acpi_table().
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all
Integration Instructions
- Review the updated expectations for
AcpiTable::new<T>().
More Details
Address Sanitizer output before
**patina_acpi: Prevent cloning invalid buffers**commit:==54216==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x1201608ae173 at pc 0x7ff7f7136d1a bp 0x0096809fe850 sp 0x0096809fe860 READ of size 4 at 0x1201608ae173 thread T7 #0 0x7ff7f7136d19 in <patina_acpi::acpi_table::AcpiTableHeader as core::clone::Clone>::clone C:\src\patina\components\patina_acpi\src\acpi_table.rs:292 #1 0x7ff7f7103f2e in <patina_acpi::acpi::StandardAcpiProvider<patina::boot_services::MockBootServices>>::get_xsdt_address_from_rsdp C:\src\patina\components\patina_acpi\src\acpi.rs:258 #2 0x7ff7f706e908 in patina_acpi::acpi::tests::test_get_xsdt_address C:\src\patina\components\patina_acpi\src\acpi.rs:1287 #3 0x7ff7f70f3da7 in patina_acpi::acpi::tests::test_get_xsdt_address::{closure#0} C:\src\patina\components\patina_acpi\src\acpi.rs:1247 #4 0x7ff7f70d5f71 in <patina_acpi::acpi::tests::test_get_xsdt_address::{closure#0} as core::ops::function::FnOnce<()>>::call_once C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250 #5 0x7ff7f713779f in core::ops::function::FnOnce::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:250 #6 0x7ff7f713779f in test::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,alloc::string::String> >,enum2$<core::result::Result<tuple$<>,alloc::string::String> > (*)()> /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:663 #7 0x7ff7f7144f5c in test::run_test_in_process::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:686 #8 0x7ff7f7144f5c in core::panic::unwind_safe::impl$25::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\panic\unwind_safe.rs:274 #9 0x7ff7f7144f5c in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #10 0x7ff7f7144f5c in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #11 0x7ff7f7144f5c in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #12 0x7ff7f7144f5c in test::run_test_in_process /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:686 #13 0x7ff7f7144f5c in test::run_test::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:607 #14 0x7ff7f713f29b in test::run_test::closure$1 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:637 #15 0x7ff7f713f29b in std::sys::backtrace::__rust_begin_short_backtrace::<test::run_test::{closure#1}, ()> /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\backtrace.rs:160 #16 0x7ff7f7148941 in std::thread::lifecycle::spawn_unchecked::closure$1::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:92 #17 0x7ff7f7148941 in core::panic::unwind_safe::impl$25::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\panic\unwind_safe.rs:274 #18 0x7ff7f7148941 in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #19 0x7ff7f7148941 in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #20 0x7ff7f7148941 in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #21 0x7ff7f7148941 in std::thread::lifecycle::spawn_unchecked::closure$1 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:90 #22 0x7ff7f7148941 in core::ops::function::FnOnce::call_once<std::thread::lifecycle::spawn_unchecked::closure_env$1<test::run_test::closure_env$1,tuple$<> >,tuple$<> > /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:250 #23 0x7ff7f72b2357 in alloc::boxed::impl$31::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\alloc\src\boxed.rs:2206 #24 0x7ff7f72b2357 in std::sys::thread::windows::impl$0::new::thread_start /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\thread\windows.rs:59 #25 0x7ffdeafcd19c in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170 #26 0x7ffeb7e7e8d6 (C:\WINDOWS\System32\KERNEL32.DLL+0x18002e8d6) #27 0x7ffeb9acc53b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18008c53b) 0x1201608ae173 is located 0 bytes after 35-byte region [0x1201608ae150,0x1201608ae173) allocated by thread T7 here: #0 0x7ffdeafbac48 in RtlAllocateHeap D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_malloc_win.cpp:1476 #1 0x7ff7f727de75 in alloc::alloc::alloc C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:178 #2 0x7ff7f727de75 in alloc::alloc::Global::alloc_impl C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:190 #3 0x7ff7f727e5ba in <alloc::alloc::Global as core::alloc::Allocator>::allocate_zeroed C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\alloc.rs:257 #4 0x7ff7f727d822 in <alloc::raw_vec::RawVecInner>::try_allocate_in C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec\mod.rs:470 #5 0x7ff7f722c6c3 in alloc::raw_vec::RawVecInner<alloc::alloc::Global>::with_capacity_zeroed_in C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec\mod.rs:443 #6 0x7ff7f722c6c3 in alloc::raw_vec::RawVec<u8,alloc::alloc::Global>::with_capacity_zeroed_in C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\raw_vec\mod.rs:208 #7 0x7ff7f722c6c3 in <u8 as alloc::vec::spec_from_elem::SpecFromElem>::from_elem::<alloc::alloc::Global> C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\vec\spec_from_elem.rs:51 #8 0x7ff7f7183679 in alloc::vec::from_elem::<u8> C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc\src\vec\mod.rs:3563 #9 0x7ff7f7065925 in patina_acpi::acpi::tests::mock_rsdp C:\src\patina\components\patina_acpi\src\acpi.rs:1212 #10 0x7ff7f706e8f4 in patina_acpi::acpi::tests::test_get_xsdt_address C:\src\patina\components\patina_acpi\src\acpi.rs:1287 #11 0x7ff7f70f3da7 in patina_acpi::acpi::tests::test_get_xsdt_address::{closure#0} C:\src\patina\components\patina_acpi\src\acpi.rs:1247 #12 0x7ff7f70d5f71 in <patina_acpi::acpi::tests::test_get_xsdt_address::{closure#0} as core::ops::function::FnOnce<()>>::call_once C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250 #13 0x7ff7f713779f in core::ops::function::FnOnce::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:250 #14 0x7ff7f713779f in test::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,alloc::string::String> >,enum2$<core::result::Result<tuple$<>,alloc::string::String> > (*)()> /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:663 #15 0x7ff7f7144f5c in test::run_test_in_process::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:686 #16 0x7ff7f7144f5c in core::panic::unwind_safe::impl$25::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\panic\unwind_safe.rs:274 #17 0x7ff7f7144f5c in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #18 0x7ff7f7144f5c in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #19 0x7ff7f7144f5c in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #20 0x7ff7f7144f5c in test::run_test_in_process /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:686 #21 0x7ff7f7144f5c in test::run_test::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:607 #22 0x7ff7f713f29b in test::run_test::closure$1 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:637 #23 0x7ff7f713f29b in std::sys::backtrace::__rust_begin_short_backtrace::<test::run_test::{closure#1}, ()> /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\backtrace.rs:160 #24 0x7ff7f7148941 in std::thread::lifecycle::spawn_unchecked::closure$1::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:92 #25 0x7ff7f7148941 in core::panic::unwind_safe::impl$25::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\panic\unwind_safe.rs:274 #26 0x7ff7f7148941 in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #27 0x7ff7f7148941 in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #28 0x7ff7f7148941 in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #29 0x7ff7f7148941 in std::thread::lifecycle::spawn_unchecked::closure$1 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:90 #30 0x7ff7f7148941 in core::ops::function::FnOnce::call_once<std::thread::lifecycle::spawn_unchecked::closure_env$1<test::run_test::closure_env$1,tuple$<> >,tuple$<> > /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:250 #31 0x7ff7f72b2357 in alloc::boxed::impl$31::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\alloc\src\boxed.rs:2206 #32 0x7ff7f72b2357 in std::sys::thread::windows::impl$0::new::thread_start /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\thread\windows.rs:59 #33 0x7ffdeafcd19c in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170 #34 0x7ffeb7e7e8d6 (C:\WINDOWS\System32\KERNEL32.DLL+0x18002e8d6) #35 0x7ffeb9acc53b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18008c53b) Thread T7 created by T0 here: #0 0x7ffdeafcd597 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:228 #1 0x7ff7f729c7b6 in <std::sys::thread::windows::Thread>::new /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\thread\windows.rs:32 #2 0x7ff7f714ba29 in std::thread::lifecycle::spawn_unchecked /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:138 #3 0x7ff7f714ba29 in std::thread::builder::Builder::spawn_unchecked /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\builder.rs:265 #4 0x7ff7f714ba29 in std::thread::builder::Builder::spawn /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\builder.rs:194 #5 0x7ff7f714ba29 in test::run_test /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:637 #6 0x7ff7f7163685 in test::run_tests /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:447 #7 0x7ff7f7163685 in test::console::run_tests_console /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\console.rs:327 #8 0x7ff7f714d6a4 in test::test_main_with_exit_callback /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:160 #9 0x7ff7f714d6a4 in test::test_main /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:101 #10 0x7ff7f7149a02 in test::test_main_static /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:183 #11 0x7ff7f7113d34 in patina_acpi::main C:\src\patina\components\patina_acpi\src\lib.rs:1 #12 0x7ff7f70d531a in <fn() as core::ops::function::FnOnce<()>>::call_once C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250 #13 0x7ff7f70e7f8d in std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()> C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:160 #14 0x7ff7f70a0dcc in std::rt::lang_start::<()>::{closure#0} C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:206 #15 0x7ff7f72ab03e in core::ops::function::impls::impl$2::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:287 #16 0x7ff7f72ab03e in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #17 0x7ff7f72ab03e in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #18 0x7ff7f72ab03e in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #19 0x7ff7f72ab03e in std::rt::lang_start_internal::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\rt.rs:175 #20 0x7ff7f72ab03e in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #21 0x7ff7f72ab03e in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #22 0x7ff7f72ab03e in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #23 0x7ff7f72ab03e in std::rt::lang_start_internal /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\rt.rs:171 #24 0x7ff7f70a0d2c in std::rt::lang_start::<()> C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:205 #25 0x7ff7f7113d58 in main (C:\src\patina\target\x86_64-pc-windows-msvc\debug\deps\patina_acpi-aff837649f2acbca.exe+0x1400b3d58) #26 0x7ff7f72cad2f in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 #27 0x7ff7f72cad2f in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 #28 0x7ffeb7e7e8d6 (C:\WINDOWS\System32\KERNEL32.DLL+0x18002e8d6) #29 0x7ffeb9acc53b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18008c53b) SUMMARY: AddressSanitizer: heap-buffer-overflow C:\src\patina\components\patina_acpi\src\acpi_table.rs:292 in <patina_acpi::acpi_table::AcpiTableHeader as core::clone::Clone>::clone Shadow bytes around the buggy address: 0x1201608ade80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1201608adf00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1201608adf80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1201608ae000: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 04 fa 0x1201608ae080: fa fa 00 00 00 00 04 fa fa fa 00 00 00 00 04 fa =>0x1201608ae100: fa fa 00 00 00 00 04 fa fa fa 00 00 00 00[03]fa 0x1201608ae180: fa fa 00 00 00 00 04 fa fa fa fd fd fd fd fd fd 0x1201608ae200: fa fa fd fd fd fd fd fa fa fa fd fd fd fd fd fa 0x1201608ae280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1201608ae300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1201608ae380: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==54216==ABORTING error: test failed, to rerun pass `-p patina_acpi --lib`
Address Sanitizer output before
**patina_acpi: Fix stack buffer access in ACPI tests**commit:==56540==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x0020413fbc64 at pc 0x7ffdeafb6437 bp 0x0020413fb580 sp 0x0020413fad10 READ of size 101 at 0x0020413fbc64 thread T6 #0 0x7ffdeafb6436 in __asan_memcpy D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_interceptors_memintrinsics.cpp:64 #1 0x7ff7f6c40699 in core::ptr::copy_nonoverlapping C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:547 #2 0x7ff7f6c40699 in <patina_acpi::acpi_table::AcpiTable>::new_from_ptr C:\src\patina\components\patina_acpi\src\acpi_table.rs:472 #3 0x7ff7f6b9be8a in <patina_acpi::acpi_table::AcpiTable>::new::<patina_acpi::acpi_table::AcpiTableHeader> C:\src\patina\components\patina_acpi\src\acpi_table.rs:428 #4 0x7ff7f6b839ff in patina_acpi::acpi::tests::test_get_table_at_idx_basic C:\src\patina\components\patina_acpi\src\acpi.rs:1514 #5 0x7ff7f6c01ca7 in patina_acpi::acpi::tests::test_get_table_at_idx_basic::{closure#0} C:\src\patina\components\patina_acpi\src\acpi.rs:1506 #6 0x7ff7f6be41e1 in <patina_acpi::acpi::tests::test_get_table_at_idx_basic::{closure#0} as core::ops::function::FnOnce<()>>::call_once C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250 #7 0x7ff7f6c455bf in core::ops::function::FnOnce::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:250 #8 0x7ff7f6c455bf in test::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,alloc::string::String> >,enum2$<core::result::Result<tuple$<>,alloc::string::String> > (*)()> /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:663 #9 0x7ff7f6c52d7c in test::run_test_in_process::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:686 #10 0x7ff7f6c52d7c in core::panic::unwind_safe::impl$25::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\panic\unwind_safe.rs:274 #11 0x7ff7f6c52d7c in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #12 0x7ff7f6c52d7c in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #13 0x7ff7f6c52d7c in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #14 0x7ff7f6c52d7c in test::run_test_in_process /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:686 #15 0x7ff7f6c52d7c in test::run_test::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:607 #16 0x7ff7f6c4d0bb in test::run_test::closure$1 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:637 #17 0x7ff7f6c4d0bb in std::sys::backtrace::__rust_begin_short_backtrace::<test::run_test::{closure#1}, ()> /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\backtrace.rs:160 #18 0x7ff7f6c56761 in std::thread::lifecycle::spawn_unchecked::closure$1::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:92 #19 0x7ff7f6c56761 in core::panic::unwind_safe::impl$25::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\panic\unwind_safe.rs:274 #20 0x7ff7f6c56761 in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #21 0x7ff7f6c56761 in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #22 0x7ff7f6c56761 in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #23 0x7ff7f6c56761 in std::thread::lifecycle::spawn_unchecked::closure$1 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:90 #24 0x7ff7f6c56761 in core::ops::function::FnOnce::call_once<std::thread::lifecycle::spawn_unchecked::closure_env$1<test::run_test::closure_env$1,tuple$<> >,tuple$<> > /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:250 #25 0x7ff7f6dbfc17 in alloc::boxed::impl$31::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\alloc\src\boxed.rs:2206 #26 0x7ff7f6dbfc17 in std::sys::thread::windows::impl$0::new::thread_start /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\thread\windows.rs:59 #27 0x7ffdeafcd19c in asan_thread_start D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:170 #28 0x7ffeb7e7e8d6 (C:\WINDOWS\System32\KERNEL32.DLL+0x18002e8d6) #29 0x7ffeb9acc53b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18008c53b) Address 0x0020413fbc64 is located in stack of thread T6 at offset 324 in frame #0 0x7ff7f6b9bb9f in <patina_acpi::acpi_table::AcpiTable>::new::<patina_acpi::acpi_table::AcpiTableHeader> C:\src\patina\components\patina_acpi\src\acpi_table.rs:422 This frame has 5 object(s): [32, 48) '_14' (line 428) [64, 88) '_13' (line 428) [128, 168) '_5' (line 424) [208, 248) '_4' (line 424) [288, 324) 'table1' (line 424) <== Memory access at offset 324 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp, SEH and C++ exceptions *are* supported) Thread T6 created by T0 here: #0 0x7ffdeafcd597 in CreateThread D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\asan\asan_win.cpp:228 #1 0x7ff7f6daa076 in <std::sys::thread::windows::Thread>::new /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\sys\thread\windows.rs:32 #2 0x7ff7f6c59849 in std::thread::lifecycle::spawn_unchecked /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\lifecycle.rs:138 #3 0x7ff7f6c59849 in std::thread::builder::Builder::spawn_unchecked /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\builder.rs:265 #4 0x7ff7f6c59849 in std::thread::builder::Builder::spawn /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\thread\builder.rs:194 #5 0x7ff7f6c59849 in test::run_test /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:637 #6 0x7ff7f6c714a5 in test::run_tests /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:447 #7 0x7ff7f6c714a5 in test::console::run_tests_console /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\console.rs:327 #8 0x7ff7f6c5b4c4 in test::test_main_with_exit_callback /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:160 #9 0x7ff7f6c5b4c4 in test::test_main /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:101 #10 0x7ff7f6c57822 in test::test_main_static /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\test\src\lib.rs:183 #11 0x7ff7f6c21b74 in patina_acpi::main C:\src\patina\components\patina_acpi\src\lib.rs:1 #12 0x7ff7f6be34ea in <fn() as core::ops::function::FnOnce<()>>::call_once C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250 #13 0x7ff7f6bf5efd in std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()> C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:160 #14 0x7ff7f6baef9c in std::rt::lang_start::<()>::{closure#0} C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:206 #15 0x7ff7f6db88fe in core::ops::function::impls::impl$2::call_once /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\core\src\ops\function.rs:287 #16 0x7ff7f6db88fe in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #17 0x7ff7f6db88fe in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #18 0x7ff7f6db88fe in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #19 0x7ff7f6db88fe in std::rt::lang_start_internal::closure$0 /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\rt.rs:175 #20 0x7ff7f6db88fe in std::panicking::catch_unwind::do_call /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:581 #21 0x7ff7f6db88fe in std::panicking::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panicking.rs:544 #22 0x7ff7f6db88fe in std::panic::catch_unwind /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\panic.rs:359 #23 0x7ff7f6db88fe in std::rt::lang_start_internal /rustc/f5209000832c9d3bc29c91f4daef4ca9f28dc797/library\std\src\rt.rs:171 #24 0x7ff7f6baeefc in std::rt::lang_start::<()> C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\rt.rs:205 #25 0x7ff7f6c21b98 in main (C:\src\patina\target\x86_64-pc-windows-msvc\debug\deps\patina_acpi-aff837649f2acbca.exe+0x1400b1b98) #26 0x7ff7f6dd85ef in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 #27 0x7ff7f6dd85ef in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288 #28 0x7ffeb7e7e8d6 (C:\WINDOWS\System32\KERNEL32.DLL+0x18002e8d6) #29 0x7ffeb9acc53b (C:\WINDOWS\SYSTEM32\ntdll.dll+0x18008c53b) SUMMARY: AddressSanitizer: stack-buffer-overflow C:\Users\mikuback\.rustup\toolchains\nightly-2025-12-12-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ptr\mod.rs:547 in core::ptr::copy_nonoverlapping Shadow bytes around the buggy address: 0x0020413fb980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020413fba00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020413fba80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020413fbb00: 00 00 00 00 f1 f1 f1 f1 f8 f8 f2 f2 00 00 00 f2 0x0020413fbb80: f2 f2 f2 f2 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 =>0x0020413fbc00: f8 f8 f8 f2 f2 f2 f2 f2 00 00 00 00[04]f3 f3 f3 0x0020413fbc80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 0x0020413fbd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0020413fbd80: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f8 f2 f8 f2 0x0020413fbe00: f8 f2 f8 f2 f8 f2 f8 f2 f8 f2 f8 f8 f8 f2 f2 f2 0x0020413fbe80: f2 f2 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 f8 f2 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==56540==ABORTING error: test failed, to rerun pass `-p patina_acpi --lib`</blockquote> <hr> </details>
-
patina\_dxe\_core: Fix invalid access in test\_fv\_functionality() @makubacki (#1366)
Change Details
## Description
The
test_fv_functionality()test created an invalid firmware volume base address by adding 0x1000 to a protocol interface pointer:/* Corrupt the base address to cover error conditions */ let base_no2: u64 = fv_interface3.as_mut() as *mut _ as u64 + 0x1000;
This produced an address pointing into unrelated memory.
A read from that address is attempted later in a call stack starting from
fv_get_volume_attributes_efiapi():test_fv_functionality()callsfv_get_volume_attributes_efiapi(fv_ptr3_const, fv_attributes)fv_get_volume_attributes_efiapi()calls intofv_get_volume_attributes()fv_get_volume_attributes()callsVolumeRef::new_from_address(physical_address)VolumeRef::new_from_address()doesptr::read_unaligned(base_address as *const fv::Header)
This change updates the test to avoid reading from an arbitrary invalid address, replacing it with a pointer to a leaked buffer of zeros.
The buffer is sized to hold an
fv::Header. Since the buffer is filled with zeros, it does not contain a valid_FVHsignature, so the signature check fails and returnsDataCorruptas the test expects.- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all
Integration Instructions
- N/A
📖 Documentation Updates
-
patina\_test: Better support multiple TestRunners @Javagedes (#1360)
Change Details
## Description
patina_testhas always supported multiple TestRunner components to easily group tests together and have them executed. With the addition of different test triggers (such as test execution on specific UEFI events), the existing architecture has broken down. While it works, tests are currently executed more than expected (e.g. eachTestRunnerwill run the test if there is an overlap in test cases). Additionally test result reporting is also logged perTestRunnerbut reports the total culmination of all tests executed.This commit represents a large rework to resolve these issues by moving test management and execution to a private service while each
TestRunnercomponent is only responsible for registering tests with the single underlying service.This impact of this commit is that each test is now only registered once, even if multiple
TestRunnercomponents specify the test case. Additionally, test reporting is now done by the underlying service, which prevents test results being reported multiple times. Additionally,Immediate(nowManual) tests were originally run during component execution. This has been pushed off toReady to BootandExit Boot Servicesto allow all components to execute. Finally, each component may register its own test error handler. With these changes, if a test failure occurs, anyTestRunnerthat registered that test to run, will have its handler executed.- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Registered multiple TestRunner components with various scenarios and verified that:
- All test handler failures are executed
- Each test is only executed once regarldess of how many
TestRunnercomponents include the test in it's scope. - Tests based off of events or timers only execute once per trigger, rather than once per
TestRunnerper trigger.
Integration Instructions
N/A
-
Add Patina QEMU PR Validation Workflow docs @makubacki (#1362)
Change Details
## Description
Adds documents to explain the design of the QEMU PR Validation workflow used in the patina repository.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make all
Integration Instructions
- N/A
-
Short doc update on ACPI progress @berlin-with0ut-return (#1327)
Change Details
## Description Include current status of ACPI in README.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
N/A.
Integration Instructions
N/A.
-
Docs: Update install command for UefiExt.dll @cfernald (#1355)
Change Details
## Description
Updates docs for quick UefiExt install command to reflect the added script in microsoft/uefi_debug_tools#22.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
N/A
Integration Instructions
N/A
-
RFC Amendment: Major branch evaluation @makubacki (#1345)
Change Details
## Description
Update the Patina Release Process RFC to indicate that the "major branch" process is being evaluated in Patina.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- CI
Integration Instructions
- N/A
Full Changelog: patina-v20.0.3...v20.1.0