microsoft / microsoft/Windows-Driver-Developer-Supplemental-Tools

When using the NuGet WDK, DVL report shows many false positives

Open
#227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CodeQL
Stars
85
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Upon running DVL, several CodeQL defects for SEMMLE_RECOMMENDED_FAILED, SEMMLE_MUSTFIX_FAILED and even SEMMLE_MUSTRUN_SKIPPED were found (even though mustrun.qls was used).
All of them were indicated on wdm.h, ntstrsafe.h and ntintsafe.h rather than on driver source code.
This was not a blocker for the Static Tools Logo Test, but IMO is worth pointing out.

The following setup was used:
NuGet packages:

  <package id="Microsoft.Windows.SDK.CPP" version="10.0.28000.1839" targetFramework="native" />
  <package id="Microsoft.Windows.SDK.CPP.x64" version="10.0.28000.1839" targetFramework="native" />
  <package id="Microsoft.Windows.WDK.x64" version="10.0.28000.1839" targetFramework="native" />

CodeQL version: v2.25.5
Packs used: microsoft/windows-drivers@1.10.0 microsoft/cpp-queries@0.0.5
Suite: microsoft/windows-drivers@1.10.0:windows-driver-suites/mustrun.qls

DVL.XML:

<?xml version="1.0" encoding="utf-8"?> 
<Data version="1.1.0.0"> 
<AssessmentScore ScoreName="xstdvga.x64.SDV.NORUN" ScoreValue="0" ScoreUnit="" />

<AssessmentScore ScoreName="xstdvga.x64.CodeAnalysis.Summary" ScoreValue="0" ScoreUnit="Types of defects seen" />

<AssessmentScore ScoreName="xstdvga.x64.Semmle.Summary" ScoreValue="5" ScoreUnit="Types of defects seen and/or rules not run" />
<AssessmentScore ScoreName="xstdvga.x64.Semmle.Defect.cpp/suspicious-pointer-scaling" ScoreValue="2" ScoreUnit="SEMMLE_RECOMMENDED_FAILED" />
<AssessmentScore ScoreName="xstdvga.x64.Semmle.Defect.cpp/drivers/wdk-deprecated-api" ScoreValue="6" ScoreUnit="SEMMLE_MUSTFIX_FAILED" />
<AssessmentScore ScoreName="xstdvga.x64.Semmle.Defect.cpp/drivers/extended-deprecated-apis" ScoreValue="3" ScoreUnit="SEMMLE_MUSTFIX_FAILED" />
<AssessmentScore ScoreName="xstdvga.x64.Semmle.Defect.cpp/conditionally-uninitialized-variable" ScoreValue="2" ScoreUnit="SEMMLE_RECOMMENDED_FAILED" />
<AssessmentScore ScoreName="xstdvga.x64.Semmle.Defect.cpp/uninitializedptrfield" ScoreValue="1" ScoreUnit="SEMMLE_MUSTRUN_SKIPPED" />

<AssessmentScore ScoreName="xstdvga.x64.General.Checksum" ScoreValue="i1KDpRWJMuSjSNzgvLMvErLpyHSB0Zpxk/ehFCPIoU4WzdUy3kqJ5jOgwr0xmwVmkp8nICQV5YxY2aeMnK4p+w==" ScoreUnit="DVL Checksum Value" />
</Data>

Build workflow: https://github.com/xcp-ng/win-xstdvga/blob/master/.github/workflows/build-dvl.yml
SARIF: https://gist.github.com/dinhngtu/ad6a57fb07f0d98297d1765d82ba3861

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked .github/workflows/build-dvl.yml workflow and inspect the linked SARIF results, focusing on findings reported in wdm.h, ntstrsafe.h, and ntintsafe.h. Reproduce the setup with the listed NuGet packages, CodeQL version, packs, and mustrun.qls suite; done means the false-positive or skipped-rule behavior is explained and an appropriate correction or handling is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.