Skip to content

patina-v20.1.1

Choose a tag to compare

@github-actions github-actions released this 13 Mar 19:46
· 235 commits to refs/heads/main since this release
234c321

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 Xorshift64starHasher from patina_dxe_core to a shared patina::hash module and replace the simple wrapping-add checksum in SmbiosManager with 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) and patina_dxe_core (541 passed) continue to pass. New unit tests added in patina::hash covering 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::Status to streamline error conversion in FFI protocol functions, simplifying add_ext, update_string_ext, and remove_ext from patina::error::EfiError::from(e).into() to e.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 all passes — 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
    1. 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
      
    2. Improve safety in FFS section parsing by replacing direct slice indexing with
      bounds checked get() 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 SmbiosError to efi::Status conversion in protocol.rs by using the existing From<SmbiosError> for EfiError impl and the EfiErrorefi::Status conversion chain, instead of manual match arms in each FFI function (add_ext, update_string_ext, remove_ext).

    Additionally, RecordTooSmall and StringPoolTooSmall are remapped from EfiError::InvalidParameter to EfiError::BufferTooSmall for 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 new BufferTooSmall mappings in test_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:

    image
    • 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_rva set to true when parsing the DXE Core using UefiPeInfo::parse().

    https://github.com/OpenDevicePartnership/patina/blob/dc285f1dffa57087a72f6bfd956d36db93e8b31f/patina_dxe_core/src/gcd/spin_locked_gcd.rs#L2317-L2323

    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 ParseOptions with resolve_rva set to false.

    A new method parse_mapped() is added to UefiPeInfo that allows sets this option and is used when parsing the DXE Core in spin_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.yml workflow 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)

    image

    PR Merged

    image

    Example of GitHub Annotations

    PR Closed (Branch Deleted)

    image
      </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_tests is 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() and expand_device_path() from patina_boot into sdk/patina/src/device_path/helpers.rs as generically useful utilities. These functions detect short-form (partial) device paths and expand them by matching against the current device topology via LocateDevicePath.

    This makes the helpers available to any SDK consumer without depending on the patina_boot component.

    Closes #1299

    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    • cargo make all passes (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-path feature 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