patina-v20.1.1
What's Changed
-
Extended x64 exception handler to parse supervisor bit @kuqin12 (#1398)
Change Details
## Description
In the programmers' manual the exception data of page fault also defined the level of access that tripped the exception. This change adds the print message when page fault is hit based on the bit status.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
This was tested in a kernel-user mode isolated environment and printed the exception as expected.
Integration Instructions
N/A
</blockquote> <hr> </details>
-
Use Xorshift64starHasher for SMBIOS table modification detection @kat-perez (#1388)
Change Details
## Description
Move
Xorshift64starHasherfrompatina_dxe_coreto a sharedpatina::hashmodule and replace the simple wrapping-add checksum inSmbiosManagerwith the hasher. This avoids false negatives when multiple byte changes cancel each other out.Closes #1161
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Existing tests in
patina_smbios(134 passed) andpatina_dxe_core(541 passed) continue to pass. New unit tests added inpatina::hashcovering seed behavior, determinism, and byte-swap detection.Integration Instructions
N/A
-
Add From\ for efi::Status conversion @kat-perez (#1387)
Change Details
## Description
Adds
impl From<SmbiosError> for efi::Statusto streamline error conversion in FFI protocol functions, simplifyingadd_ext,update_string_ext, andremove_extfrompatina::error::EfiError::from(e).into()toe.into().Implements feedback from @Javagedes on #1384 (which auto-merged before this could be addressed).
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make allpasses — all tests, clippy, fmt, deny, and doc checks clean.Integration Instructions
N/A
-
Patina: Fix RAW FFS file handling and harden section parsing @vineelko (#1369)
Change Details
## Description
-
Handle RAW File types:
-
The current implementation tries to produce sections irrespective of the file
type. This do not hold true for RAW file types. As per PI spec below,The file type EFI_FV_FILETYPE_RAW denotes a file that does not contain
sections and is treated as a raw data file. The consumer of this type of
file must have a priori knowledge of its format and content. Because there
are no sections, there are no construction rules. -
Trying to decode the body of these files as Section header can result in
incorrect parsing.
Fixes the following bug:
[ INFO]: \patina\sdk\patina\src\pi\serializable\serializable_fv.rs@078: Parsing FV: d2c29ba7-3809-480f-9c3d-de389c61425a [ INFO]: \patina\sdk\patina\src\pi\serializable\serializable_fv.rs@089: Parsing file: 197db236-f856-4924-90f8-cdf12fb875f3 [ INFO]: \patina\sdk\patina\src\pi\fw_fs.rs@801: Section type 0x0 unrecognized 4 1, treating as opaque with no metadata [ERROR]: dxe_readiness_capture\src\lib.rs@031: panicked at \patina\sdk\patina\src\pi\fw_fs.rs:805:56: [ERROR]: dxe_readiness_capture\src\lib.rs@031: slice index starts at 4 but ends at 1 -
-
Improve safety in FFS section parsing by replacing direct slice indexing with
bounds checkedget()calls and proper error propagation when buffers are
malformed. General code cleanup.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Booted to UEFI Shell on Q35
Integration Instructions
NA
-
-
Centralize SmbiosError to EFI Status conversion using From impl @kat-perez (#1384)
Change Details
## Description
Centralize the
SmbiosErrortoefi::Statusconversion in protocol.rs by using the existingFrom<SmbiosError> for EfiErrorimpl and theEfiError→efi::Statusconversion chain, instead of manual match arms in each FFI function (add_ext,update_string_ext,remove_ext).Additionally,
RecordTooSmallandStringPoolTooSmallare remapped fromEfiError::InvalidParametertoEfiError::BufferTooSmallfor more accurate error semantics.Closes #1163
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Ran
cargo test -p patina_smbios— all 134 tests pass, including updated assertions for the newBufferTooSmallmappings intest_smbios_error_to_efi_error_conversion.Integration Instructions
N/A
-
patina\_acpi: do not specify resolver @Javagedes (#1379)
Change Details
## Description
Updates patina_acpi toml configuration to not specify the resolver version as the resolver version is specified by the workspace configuration toml and any specified resolver version in individual crates are ignored.
Clears this warning:
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
N/A
Integration Instructions
N/A
</blockquote> <hr> </details>
-
patina\_dxe\_core/pecoff: Add parse\_mapped() @makubacki (#1378)
Change Details
## Description
Resolves OpenDevicePartnership/patina-dxe-core-qemu#134
Right now, we have
resolve_rvaset to true when parsing the DXE Core usingUefiPeInfo::parse().Which calls with
goblin::pe::PE::parse(bytes)to parse the image.By default, goblin will attempt to resolve RVAs to file offsets when parsing a PE file. However, since the DXE Core is already loaded into memory, we want to parse it, in this case, without resolving RVAs using PointerToRawData offsets.
Depending on the content at the resolved address, this can lead to parsing errors like:
Failed to parse PE info for DXE Core: Goblin(Malformed("ImageDebugDirectory size of data seems wrong: 0"))It appears that this has been present for a long time, likely since the decision (around c821bf9) to start parsing the DXE Core's own loaded PE image and a recent shift in linked contents has exposed the problem.
It is possible to disable RVA resolution by using
ParseOptionswithresolve_rvaset to false.A new method
parse_mapped()is added toUefiPeInfothat allows sets this option and is used when parsing the DXE Core inspin_locked_gcd.rs.- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Q35 and SBSA boot to EFI shell
Before the change, SBSA failed with the goblin parsing error shown in the description.
Integration Instructions
- N/A
-
Patina QEMU PR Workflow: Add unique comment for merged/closed PRs @makubacki (#1376)
Change Details
## Description
Updates the
patina-qemu-pr-validation.ymlworkflow to post a comment when a PR is either merged or the PR is closed when the workflow starts.This provides an obvious final state for the comment in those cases.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
- Tested the closed and merged cases in PR on fork (with a PR from another GitHub org)
- Tested the successful case (PR remains open) continues to work
Integration Instructions
- N/A
Examples of New Messages
PR Closed (Branch Deleted)
PR Merged
Example of GitHub Annotations
PR Closed (Branch Deleted)
</blockquote> <hr> </details>
🐛 Bug Fixes
-
Minor Patina ACPI test fixes @berlin-with0ut-return (#1393)
Change Details
## Description Patina tests now run after installation of ACPI tables. As such, we cannot use core tables (such as FADT, FACS) in integration tests as they will override critical OS tables.
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
Tests now pass + boots correctly when
enable_patina_testsis turned on.Integration Instructions
N/A.
📖 Documentation Updates
-
Move partial device path helpers to SDK device\_path module @kat-perez (#1390)
Change Details
## Description
Move
is_partial_device_path()andexpand_device_path()frompatina_bootintosdk/patina/src/device_path/helpers.rsas generically useful utilities. These functions detect short-form (partial) device paths and expand them by matching against the current device topology viaLocateDevicePath.This makes the helpers available to any SDK consumer without depending on the
patina_bootcomponent.Closes #1299
- Impacts functionality?
- Impacts security?
- Breaking change?
- Includes tests?
- Includes documentation?
How This Was Tested
cargo make allpasses (build, test, fmt, doc, coverage)- 7 unit tests covering: partial path detection (HD node, full ACPI path, empty path), expansion with full path passthrough, successful expansion with file path appending, NOT_FOUND error, and handle_protocol failure
Integration Instructions
The new helpers are behind the
unstable-device-pathfeature gate. To use them:use patina::device_path::helpers::{is_partial_device_path, expand_device_path};
</blockquote> <hr> </details>
Full Changelog: patina-v20.1.0...v20.1.1