Batch of CodeQL Fixes [Rebase & FF]#257
Merged
makubacki merged 3 commits intoFeb 10, 2023
Merged
Conversation
os-d
approved these changes
Feb 9, 2023
apop5
approved these changes
Feb 9, 2023
7032915 to
12363d8
Compare
Makes changes to comply with alerts raised by CodeQL. A prior pass with a subset of queries used here was already done so this is mostly addressing issues discovered by enabling a few new queries. Most of the issues here fall into the following two categories: 1. Potential use of uninitialized pointer 2. Inconsistent integer width used in loop comparison - [ ] Breaking change? - Will this change break pre-existing builds or functionality without action being taken? **No** - Should just be refactoring to address alerts 1. Verified CI build 2. Verified boot to EFI shell on QemuQ35Pkg N/A Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> (cherry picked from commit 43e657c)
The CodeQL Analyze build plugin allows a global configuration file to be specified for a repo that can define file patterns against CodeQL rules to include and exclude results for the given file and rule. More details are in the plugin readme: https://github.com/microsoft/mu_basecore/blob/release/202208/.pytool/Plugin/CodeQL/Readme.md#global-configuration This change calls out addition of this file for future usage. The global configuration file is useful in mu_basecore (vs specifying the filters in individual package CI YAML files) because the repo has high reuse. Integration repos can easily see all of the filter activity in one file that is easy to inspect and include in their build if needed. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Includes changes across the repo for the following CodeQL rules: - cpp/comparison-with-wider-type - cpp/overflow-buffer - cpp/redundant-null-check-param - cpp/uselesstest Some false positives are filtered in CodeQlFilters.yml. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
12363d8 to
bfab119
Compare
kat-perez
pushed a commit
to kat-perez/mu_basecore
that referenced
this pull request
Nov 9, 2025
) ## Description There are often many ranges exempt from the RWX test, and printing every exempt region to the log can overflow the XML buffer and result in the actual failing ranges not to be printed. To reduce the likelihood of missing failing ranges in the output XML, this PR removes the UT_LOG calls for exempt regions. - [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, ... - [x] 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 Running on Q35 ## Integration Instructions N/A
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 2, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 15, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 16, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 17, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 19, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 22, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Dec 30, 2025
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
to apop5/mu_basecore
that referenced
this pull request
Jan 7, 2026
…oft#257) Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
that referenced
this pull request
Jan 10, 2026
Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
that referenced
this pull request
Jan 12, 2026
Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
that referenced
this pull request
Jan 13, 2026
Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
that referenced
this pull request
Jan 15, 2026
Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
that referenced
this pull request
Jan 28, 2026
Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
apop5
pushed a commit
that referenced
this pull request
Feb 5, 2026
Currently, if the TCG log fills up, the firmware will boot only logging some errors and the OS may or may not fail depending on scenario and configuration. This PR adds an assert so that these truncations can be found in testing rather then having to wait for failures in production. - [X] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? N/A N/A cherry-pick from 1c115e6083 Signed-off-by: Chris Fernald <chfernal@microsoft.com>
Raymond-MS
added a commit
to Raymond-MS/mu_basecore
that referenced
this pull request
Jun 12, 2026
…microsoft#257)" This reverts commit 348b4bd.
makubacki
pushed a commit
to Raymond-MS/mu_basecore
that referenced
this pull request
Jun 24, 2026
…microsoft#257)" This reverts commit 348b4bd.
Raymond-MS
added a commit
to Raymond-MS/mu_basecore
that referenced
this pull request
Jun 25, 2026
…microsoft#257)" This reverts commit 348b4bd.
Raymond-MS
added a commit
to Raymond-MS/mu_basecore
that referenced
this pull request
Jun 25, 2026
…microsoft#257)" This reverts commit 348b4bd.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Includes 3 commits that do the following:
flow, or firmware?
validation improvement, ...
in build or boot behavior?
a function in a new library class in a pre-existing module, ...
outside direct code modifications (and comments)?
on an a separate Web page, ...
How This Was Tested
Integration Instructions
N/A - Can help resolve some CodeQL alerts that may have been observed.
Signed-off-by: Michael Kubacki michael.kubacki@microsoft.com