[edk2-devel] [PATCH v2 0/2] Enable CodeQL Failures and Add New Queries

Michael Kubacki posted 2 patches 1 year, 5 months ago
Failed in applying to current master (apply log)
BaseTools/Source/C/EfiRom/EfiRom.c          | 2 +-
BaseTools/Source/C/GenFv/GenFvInternalLib.c | 2 +-
BaseTools/Source/C/GenFw/Elf32Convert.c     | 2 +-
BaseTools/Source/C/GenFw/Elf64Convert.c     | 6 +++---
BaseTools/Source/C/GenSec/GenSec.c          | 4 ++--
.github/codeql/codeql-config.yml            | 1 -
.github/codeql/edk2.qls                     | 4 +++-
7 files changed, 11 insertions(+), 10 deletions(-)
[edk2-devel] [PATCH v2 0/2] Enable CodeQL Failures and Add New Queries
Posted by Michael Kubacki 1 year, 5 months ago
From: Michael Kubacki <michael.kubacki@microsoft.com>

When CodeQL was enabled, the goal was to enable the flow and not
impact build results. cpp/conditionallyuninitializedvariable was
the first and only query enabled with all CodeQL results filtered
out from affecting CI results.

This achieved the goal to enable CodeQL for future changes to build
upon but always get CodeQL successful runs in the meantime.

This patch series:
1. Swaps out that initial "placeholder" query with two queries that
   can be enabled with no code changes.
2. Enables "error" level CodeQL alerts.
3. Makes fixes made for a default query
   cpp/wrong-type-format-argument in BaseTools.

The results for (3) can be seen in the following Code Scanning
results that show the PR with these changes fixed the alerts raised
by CodeQL.

PR: https://github.com/tianocore/edk2/pull/3617

Code Scanning results (access may be required):
https://github.com/tianocore/edk2/security/code-scanning?query=pr%3A3617+tool%3ACodeQL+is%3Aclosed

V2 Changes:

1. Use *InputFileName instead of InputFileName[0] in GenSec.c
2. Add R-b tags from v1 series

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Michael Kubacki (2):
  BaseTools: Fix wrong type of arguments to formatting functions
  edk2.qls: Allow error severity results and add new queries

 BaseTools/Source/C/EfiRom/EfiRom.c          | 2 +-
 BaseTools/Source/C/GenFv/GenFvInternalLib.c | 2 +-
 BaseTools/Source/C/GenFw/Elf32Convert.c     | 2 +-
 BaseTools/Source/C/GenFw/Elf64Convert.c     | 6 +++---
 BaseTools/Source/C/GenSec/GenSec.c          | 4 ++--
 .github/codeql/codeql-config.yml            | 1 -
 .github/codeql/edk2.qls                     | 4 +++-
 7 files changed, 11 insertions(+), 10 deletions(-)

-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96124): https://edk2.groups.io/g/devel/message/96124
Mute This Topic: https://groups.io/mt/94903611/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 0/2] Enable CodeQL Failures and Add New Queries
Posted by Michael D Kinney 1 year, 5 months ago
Series Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>


> -----Original Message-----
> From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
> Sent: Tuesday, November 8, 2022 4:22 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Sean
> Brogan <sean.brogan@microsoft.com>; Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [PATCH v2 0/2] Enable CodeQL Failures and Add New Queries
> 
> From: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> When CodeQL was enabled, the goal was to enable the flow and not
> impact build results. cpp/conditionallyuninitializedvariable was
> the first and only query enabled with all CodeQL results filtered
> out from affecting CI results.
> 
> This achieved the goal to enable CodeQL for future changes to build
> upon but always get CodeQL successful runs in the meantime.
> 
> This patch series:
> 1. Swaps out that initial "placeholder" query with two queries that
>    can be enabled with no code changes.
> 2. Enables "error" level CodeQL alerts.
> 3. Makes fixes made for a default query
>    cpp/wrong-type-format-argument in BaseTools.
> 
> The results for (3) can be seen in the following Code Scanning
> results that show the PR with these changes fixed the alerts raised
> by CodeQL.
> 
> PR: https://github.com/tianocore/edk2/pull/3617
> 
> Code Scanning results (access may be required):
> https://github.com/tianocore/edk2/security/code-scanning?query=pr%3A3617+tool%3ACodeQL+is%3Aclosed
> 
> V2 Changes:
> 
> 1. Use *InputFileName instead of InputFileName[0] in GenSec.c
> 2. Add R-b tags from v1 series
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> Michael Kubacki (2):
>   BaseTools: Fix wrong type of arguments to formatting functions
>   edk2.qls: Allow error severity results and add new queries
> 
>  BaseTools/Source/C/EfiRom/EfiRom.c          | 2 +-
>  BaseTools/Source/C/GenFv/GenFvInternalLib.c | 2 +-
>  BaseTools/Source/C/GenFw/Elf32Convert.c     | 2 +-
>  BaseTools/Source/C/GenFw/Elf64Convert.c     | 6 +++---
>  BaseTools/Source/C/GenSec/GenSec.c          | 4 ++--
>  .github/codeql/codeql-config.yml            | 1 -
>  .github/codeql/edk2.qls                     | 4 +++-
>  7 files changed, 11 insertions(+), 10 deletions(-)
> 
> --
> 2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96128): https://edk2.groups.io/g/devel/message/96128
Mute This Topic: https://groups.io/mt/94903611/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-