Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202311] ImageValidation.py: Don't parse entire image #1126

Merged

Conversation

Javagedes
Copy link
Contributor

Description

This commit modifies the PE parsing functionality to only parse the headers of the image, rather than the entire image. This change is made to improve performance and also the probability of failing to parse the entire image. This comes after this commit (erocarrera/pefile#365) in pefile resulted in efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to catch any exceptions that may be raised during parsing, to cleanly exit.

See: microsoft/mu_tiano_platforms#1025 and erocarrera/pefile#421

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

How This Was Tested

Validated pipelines build on mu_tiano_platforms

Integration Instructions

N/A

This commit modifies the PE parsing functionality to only parse the
headers of the image, rather than the entire image. This change is made
to improve performance and also the probability of failing to parse the
entire image. This comes after this commit (erocarrera/pefile#365)
in pefile resulted in efi image parsing failures, breaking the build.

This commit also wraps the parsing of the image in a try-except block to
catch any exceptions that may be raised during parsing, to cleanly exit.
@github-actions github-actions bot added the impact:non-functional Does not have a functional impact label Aug 29, 2024
@Javagedes Javagedes changed the title ImageValidation.py: Don't parse entire image [202311] ImageValidation.py: Don't parse entire image Aug 29, 2024
@Javagedes Javagedes requested review from os-d, makubacki and apop5 August 29, 2024 19:32
@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 1.35%. Comparing base (750b5cd) to head (2e8f844).

Additional details and impacted files
@@               Coverage Diff               @@
##           release/202311    #1126   +/-   ##
===============================================
  Coverage            1.35%    1.35%           
===============================================
  Files                1303     1303           
  Lines              333838   333838           
  Branches             5103     5103           
===============================================
  Hits                 4512     4512           
  Misses             329243   329243           
  Partials               83       83           
Flag Coverage Δ
MdeModulePkg 0.68% <ø> (ø)
MdePkg 5.40% <ø> (ø)
NetworkPkg 0.55% <ø> (ø)
PolicyServicePkg 30.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Javagedes Javagedes merged commit ea185fb into microsoft:release/202311 Aug 29, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants