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

MdeModulePkg/HiiDatabaseDxe: Correcting a Codeql change #860

Merged
merged 1 commit into from
May 23, 2024

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented May 23, 2024

Description

Due to a change to address CodeQl issues, the HiiDatabase could not return a default values for IFRs.

It was tracked back to the conditional check encompassing too much of the code, and preventing the loop from iterating through all the possible variable storage

  • Impacts functionality?
    • Functionality - Does the change ultimately impact how firmware functions?
    • Examples: Add a new library, publish a new PPI, update an algorithm, ...
  • Impacts security?
    • Security - Does the change have a direct security impact on an application,
      flow, or firmware?
    • Examples: Crypto algorithm change, buffer overflow fix, parameter
      validation improvement, ...
  • Breaking change?
    • Breaking change - Will anyone consuming this change experience a break
      in build or boot behavior?
    • Examples: Add a new library class, move a module to a different repo, call
      a function in a new library class in a pre-existing module, ...
  • Includes tests?
    • Tests - Does the change include any explicit test code?
    • Examples: Unit tests, integration tests, robot tests, ...
  • Includes documentation?
    • Documentation - Does the change contain explicit documentation additions
      outside direct code modifications (and comments)?
    • Examples: Update readme file, add feature readme file, link to documentation
      on an a separate Web page, ...

How This Was Tested

Prior to this change, a platform loading defaults would not change all the settings, only the subset found in the first variable storage.

Integration Instructions

n/a

@apop5 apop5 requested a review from kenlautner May 23, 2024 03:05
@codecov-commenter
Copy link

codecov-commenter commented May 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 38 lines in your changes are missing coverage. Please review.

Project coverage is 1.22%. Comparing base (88c69a3) to head (4cfafb5).

Files Patch % Lines
MdeModulePkg/Universal/HiiDatabaseDxe/Database.c 0.00% 38 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/202311     #860   +/-   ##
===============================================
  Coverage            1.22%    1.22%           
===============================================
  Files                1303     1303           
  Lines              335702   335702           
  Branches             3189     3189           
===============================================
  Hits                 4118     4118           
  Misses             331508   331508           
  Partials               76       76           
Flag Coverage Δ
MdeModulePkg 0.68% <0.00%> (ø)

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.

@makubacki makubacki added the type:bug Something isn't working label May 23, 2024
@makubacki makubacki changed the title [MdeModulePkg]: HiiDatabaseDxe. Correcting a Codeql change. MdeModulePkg/HiiDatabaseDxe: Correcting a Codeql change May 23, 2024
@apop5 apop5 merged commit 13dff4f into microsoft:release/202311 May 23, 2024
35 checks passed
ProjectMuBot referenced this pull request in microsoft/mu_tiano_platforms Jun 1, 2024
Introduces 21 new commits in [MU_BASECORE](https://github.com/microsoft/mu_basecore.git).

<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/microsoft/mu_basecore/commit/e0afbf07ed3c6f2e99b79eff8b68b56102bf1f78">e0afbf</a> BinToPcd.py: Remove xdrlib import (<a href="https://github.com/microsoft/mu_basecore/pull/852">#852</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/94c9ad0fd5bd3f09f5c7eace3470dd7ed0e45352">94c9ad</a> [CHERRY-PICK] UefiCpuPkg/MpInitLib: Update the comments of _CPU_MP_DATA.</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/20f68f46c492bd0f4ec3d44644abd602a97eb951">20f68f</a> [CHERRY-PICK] UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/ed8bd2e54183320fef528308eaedbde6f0baa49f">ed8bd2</a> [CHERRY-PICK] UefiCpuPkg/MpInitLib: Copy SEV-ES save area pointer during APIC ID sorting</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/dbb8cf68c4c5ee6581a8e9266f2cf49f4cf3e353">dbb8cf</a> [CHERRY-PICK] UefiCpuPkg/PiSmmCpuDxeSmm: Use NonSmm BSP as default SMM BSP.</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/cd3ce1d2faaa2fdadafaabd9fc85a2bab6e73bdb">cd3ce1</a> [CHERRY-PICK] UefiCpuPkg/BaseXApicLib: Fix CPUID_V2_EXTENDED_TOPOLOGY detection</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/33820913d87906ddae9680a59b30581f1213e674">338209</a> [CHERRY-PICK] UefiCpuPkg/PiSmmCpuDxeSmm: Get processor extended information</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/8307ad7b1f7e3ad5592dcb70cf62d677c1793607">8307ad</a> [CHERRY-PICK] UefiCpuPkg: Create gMpInformationHobGuid2 in UefiCpuPkg</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/236d378ea337cef6eeeb77793fab3a047b7caaa6">236d37</a> [CHERRY-PICK] UefiCpuPkg: Build MpInfo2HOB in CpuMpPei</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/e3b9ca15de86fcb46e7e17a70cb78453e18fa16b">e3b9ca</a> [CHERRY-PICK] UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxe</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/84b4db3c2e86060ad45184c7a1841a01e03ae85f">84b4db</a> [CHERRY-PICK] UefiCpuPkg: Add a new field in MpInfo2 HOB</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/f380d9314efaf1cb8bf3ce7cdf0349be48998328">f380d9</a> [CHERRY-PICK] UefiCpuPkg: Cache core type in MpInfo2 HOB</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/68caaf8fdf854b59d5d73b28ce68cadd037d7e09">68caaf</a> [CHERRY-PICK] UefiCpuPkg: Avoid assuming only one smmbasehob</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/2b08534cb8874f73f321163fc411bfb9f7edcd27">2b0853</a> [CHERRY-PICK] MdeModulePkg: Support customized FV Migration Information</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/88c69a324151f03992a97c55066e75abd70a33af">88c69a</a> MdePkg/SmBios.h: Add New ProcessorUpgrade definitions for SMBIOS Type4</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/13dff4ff031a43c1941faeeb110194d61ad70821">13dff4</a> MdeModulePkg/HiiDatabaseDxe: Correcting a Codeql change (<a href="https://github.com/microsoft/mu_basecore/pull/860">#860</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/45cb26c60568b85395be1c3adf2ebcd040a0cfd6">45cb26</a> MdeModulePkg\DxeCore: BS memory allocated from SMM Entry points is still RP (<a href="https://github.com/microsoft/mu_basecore/pull/861">#861</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/7f9a27e0d7bcefd06e8d45fc06d5e906b6898911">7f9a27</a> [CHERRY-PICK] UefiCpuPkg: change name of gMpInformationHobGuid2 (<a href="https://github.com/microsoft/mu_basecore/pull/875">#875</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/ca0ae3c4a56c1eb0cd2c0c84c34bd5a09f58c3c3">ca0ae3</a> Fixing an edge case in AutoGen script where BUILDMODULE might fail (<a href="https://github.com/microsoft/mu_basecore/pull/878">#878</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/15c8d24582a300628d2c1736a443c39cabbb3c45">15c8d2</a> Repo File Sync: synced file(s) with microsoft/mu_devops (<a href="https://github.com/microsoft/mu_basecore/pull/874">#874</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/ad553d0853e98883e30442740626d820497d6918">ad553d</a> NetworkPkg TcpDxe: Fixed system stuck on PXE boot flow in iPXE enviro… (<a href="https://github.com/microsoft/mu_basecore/pull/879">#879</a>)</li>
</ul>
</details>

Signed-off-by: Project Mu Bot <mubot@microsoft.com>
makubacki referenced this pull request in microsoft/mu_tiano_platforms Jun 3, 2024
Introduces 21 new commits in [MU_BASECORE](https://github.com/microsoft/mu_basecore.git).

<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/microsoft/mu_basecore/commit/e0afbf07ed3c6f2e99b79eff8b68b56102bf1f78">e0afbf</a> BinToPcd.py: Remove xdrlib import (<a href="https://github.com/microsoft/mu_basecore/pull/852">#852</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/94c9ad0fd5bd3f09f5c7eace3470dd7ed0e45352">94c9ad</a> [CHERRY-PICK] UefiCpuPkg/MpInitLib: Update the comments of _CPU_MP_DATA.</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/20f68f46c492bd0f4ec3d44644abd602a97eb951">20f68f</a> [CHERRY-PICK] UefiCpuPkg/MpInitLib: Use AsmCpuidEx() for CPUID_EXTENDED_TOPOLOGY leaf</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/ed8bd2e54183320fef528308eaedbde6f0baa49f">ed8bd2</a> [CHERRY-PICK] UefiCpuPkg/MpInitLib: Copy SEV-ES save area pointer during APIC ID sorting</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/dbb8cf68c4c5ee6581a8e9266f2cf49f4cf3e353">dbb8cf</a> [CHERRY-PICK] UefiCpuPkg/PiSmmCpuDxeSmm: Use NonSmm BSP as default SMM BSP.</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/cd3ce1d2faaa2fdadafaabd9fc85a2bab6e73bdb">cd3ce1</a> [CHERRY-PICK] UefiCpuPkg/BaseXApicLib: Fix CPUID_V2_EXTENDED_TOPOLOGY detection</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/33820913d87906ddae9680a59b30581f1213e674">338209</a> [CHERRY-PICK] UefiCpuPkg/PiSmmCpuDxeSmm: Get processor extended information</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/8307ad7b1f7e3ad5592dcb70cf62d677c1793607">8307ad</a> [CHERRY-PICK] UefiCpuPkg: Create gMpInformationHobGuid2 in UefiCpuPkg</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/236d378ea337cef6eeeb77793fab3a047b7caaa6">236d37</a> [CHERRY-PICK] UefiCpuPkg: Build MpInfo2HOB in CpuMpPei</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/e3b9ca15de86fcb46e7e17a70cb78453e18fa16b">e3b9ca</a> [CHERRY-PICK] UefiCpuPkg: Consume MpInfo2Hob in PiSmmCpuDxe</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/84b4db3c2e86060ad45184c7a1841a01e03ae85f">84b4db</a> [CHERRY-PICK] UefiCpuPkg: Add a new field in MpInfo2 HOB</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/f380d9314efaf1cb8bf3ce7cdf0349be48998328">f380d9</a> [CHERRY-PICK] UefiCpuPkg: Cache core type in MpInfo2 HOB</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/68caaf8fdf854b59d5d73b28ce68cadd037d7e09">68caaf</a> [CHERRY-PICK] UefiCpuPkg: Avoid assuming only one smmbasehob</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/2b08534cb8874f73f321163fc411bfb9f7edcd27">2b0853</a> [CHERRY-PICK] MdeModulePkg: Support customized FV Migration Information</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/88c69a324151f03992a97c55066e75abd70a33af">88c69a</a> MdePkg/SmBios.h: Add New ProcessorUpgrade definitions for SMBIOS Type4</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/13dff4ff031a43c1941faeeb110194d61ad70821">13dff4</a> MdeModulePkg/HiiDatabaseDxe: Correcting a Codeql change (<a href="https://github.com/microsoft/mu_basecore/pull/860">#860</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/45cb26c60568b85395be1c3adf2ebcd040a0cfd6">45cb26</a> MdeModulePkg\DxeCore: BS memory allocated from SMM Entry points is still RP (<a href="https://github.com/microsoft/mu_basecore/pull/861">#861</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/7f9a27e0d7bcefd06e8d45fc06d5e906b6898911">7f9a27</a> [CHERRY-PICK] UefiCpuPkg: change name of gMpInformationHobGuid2 (<a href="https://github.com/microsoft/mu_basecore/pull/875">#875</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/ca0ae3c4a56c1eb0cd2c0c84c34bd5a09f58c3c3">ca0ae3</a> Fixing an edge case in AutoGen script where BUILDMODULE might fail (<a href="https://github.com/microsoft/mu_basecore/pull/878">#878</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/15c8d24582a300628d2c1736a443c39cabbb3c45">15c8d2</a> Repo File Sync: synced file(s) with microsoft/mu_devops (<a href="https://github.com/microsoft/mu_basecore/pull/874">#874</a>)</li>
<li><a href="https://github.com/microsoft/mu_basecore/commit/ad553d0853e98883e30442740626d820497d6918">ad553d</a> NetworkPkg TcpDxe: Fixed system stuck on PXE boot flow in iPXE enviro… (<a href="https://github.com/microsoft/mu_basecore/pull/879">#879</a>)</li>
</ul>
</details>

Signed-off-by: Project Mu Bot <mubot@microsoft.com>
apop5 added a commit to apop5/mu_basecore that referenced this pull request Jul 23, 2024
# Description

Due to a change to address CodeQl issues, the HiiDatabase could not
return a default values for IFRs.

It was tracked back to the conditional check encompassing too much of
the code, and preventing the loop from iterating through all the
possible variable storage

- [X] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Prior to this change, a platform loading defaults would not change all
the settings, only the subset found in the first variable storage.

## Integration Instructions

n/a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants