Skip to content

patina-v4.1.0

Choose a tag to compare

@github-actions github-actions released this 01 Jul 16:00
· 886 commits to refs/heads/main since this release
0bf63a9

What's Changed

  • patina-sdk: Make align\* Functions More User Friendly @os-d (#549)
    Change Details
      ## Description

    Currently the align family of functions in the sdk requires u64s to be passed in, which often requires a pattern of my_usize as u64 getting passed in and the result of this being cast back to usize. This is needless, these functions can easily be generic.

    In addition to this, these functions were passing back string errors which were universally being converted to EfiErrors. It was not using to return strings, instead return EfiErrors.

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

    How This Was Tested

    Ran local tests as well as booted Windows on Q35 and SBSA.

    Integration Instructions

    N/A. Existing users of the align functions don't need to change, but can change if they wish to make the usage simpler.

      </blockquote>
      <hr>
    </details>
    
  • chore: Release @cfernald (#550)
    Change Details
      ## Description

    Release 4.0.2

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

    How This Was Tested

    N/A

    Integration Instructions

    N/A

      </blockquote>
      <hr>
    </details>
    

🚀 Features & ✨ Enhancements

  • Add device path. @magravel (#407)
    Change Details
      ## Description

    This PR adds an abstraction over device path so we can do operations on them natively in rust. DevicePathBuf is an own version of the type and DevicePath is used as a borrow version of it. Similar to Path and PathBuf in std rust. The memory layout in the internal vector is the same as the one in C, so these structs can be easily converted and used from both languages.

    This feature is unstable for now, enable feature unstable-device-path to use it:
    #547

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

    How This Was Tested

    Converted a device path pointer from C and then printed it to see if the layout was read correctly.

    Integration Instructions

    N/A

      </blockquote>
      <hr>
    </details>
    

🐛 Bug Fixes

  • Patina: Section Extractor: Guard extractor using stmts with feature flags @vineelko (#553)
    Change Details
      ## Description

    Currently, because the use statements are not guarded by feature flags, selecting extractors via feature flags can cause build failures. This PR fixes that.

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

    How This Was Tested

    QEMU Validated

    Integration Instructions

    NA

      </blockquote>
      <hr>
    </details>
    

🔐 Security Impacting

  • gcd: use checked\_add to prevent overflow panic in bounds validation @kat-perez (#557)
    Change Details
      ## Description

    Replace unchecked addition with checked_add() in add_memory_space to prevent debug build panics when validating address ranges.

    The original base_address + len <= self.maximum_address would panic in debug builds due to Rust's overflow checking, even for safe values like 0x8000000000000002 + 0 (which is only halfway to usize::MAX on 64-bit).

    Using checked_add().is_some_and() provides the same logical validation while gracefully handling potential overflow by returning EfiError::Unsupported instead of panicking.

    • increases unit test coverage for DXE services (#269) from 3.3 to 6.2%

    • Impacts functionality?

    • Impacts security?

    • Breaking change?

    • Includes tests?

    • Includes documentation?

    How This Was Tested

    cargo make coverage

    • New unit tests were created in dxe_services.rs testing add_memory_space on the global static GCD

    Integration Instructions

    N/A

      </blockquote>
      <hr>
    </details>
    

📖 Documentation Updates

  • dxe\_core.md: Add reference to binary size details in patina-qemu @makubacki (#554)
    Change Details
      ## Description

    While the binary size analysis and optimization options use the QEMU build as an example, a reference is helpful in the main Patina documentation so it is easier to find.

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

    How This Was Tested

    • cargo make all

    Integration Instructions

    N/A




  • Add benchmarking documentation @Javagedes (#510)
    Change Details
      ## Description
    • Impacts functionality?
    • Impacts security?
    • Breaking change?
    • Includes tests?
    • Includes documentation?

    How This Was Tested

    CI

    Integration Instructions

    N/A




  • Add device path. @magravel (#407)
    Change Details
      ## Description

    This PR adds an abstraction over device path so we can do operations on them natively in rust. DevicePathBuf is an own version of the type and DevicePath is used as a borrow version of it. Similar to Path and PathBuf in std rust. The memory layout in the internal vector is the same as the one in C, so these structs can be easily converted and used from both languages.

    This feature is unstable for now, enable feature unstable-device-path to use it:
    #547

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

    How This Was Tested

    Converted a device path pointer from C and then printed it to see if the layout was read correctly.

    Integration Instructions

    N/A

      </blockquote>
      <hr>
    </details>
    

Full Changelog: patina-v4.0.2...v4.1.0