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

UefiCpuPkg/MtrrLib: Fix unit test read overflow #6419

Merged

Conversation

mdkinney
Copy link
Member

@mdkinney mdkinney commented Nov 8, 2024

Description

Change conditional check to check the array index before reading the array member to prevent read past end of buffer.

Detected with use of address sanitizer in host based unit tests in draft PR #6408

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

Run host based unit tests with address sanitizer enabled and the issue is resolved with this change

Integration Instructions

@github-actions github-actions bot added the impact:security This change has a direct security impact such as changing a crypto algorithm. label Nov 8, 2024
@mdkinney mdkinney requested a review from lgao4 November 8, 2024 19:05
@mdkinney mdkinney added the push Auto push patch series in PR if all checks pass label Nov 8, 2024
Change conditional check to check the array index before
reading the array member to prevent read past end of buffer.

Signed-off-by: Michael D Kinney <[email protected]>
@lgao4 lgao4 force-pushed the UefiCpuPkg_MtrrLib_UnitTest_ReadOverflow branch from 95ede5d to 15b1e31 Compare November 11, 2024 01:13
@mergify mergify bot merged commit 171335e into tianocore:master Nov 11, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:security This change has a direct security impact such as changing a crypto algorithm. push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants