Skip to content

Fix numerous nvme issues - see each commit - #1743

Closed
Sean Brogan (spbrogan) wants to merge 4 commits into
microsoft:release/202511from
spbrogan:fix_nvme_issues
Closed

Sean Brogan (spbrogan) wants to merge 4 commits into
microsoft:release/202511from
spbrogan:fix_nvme_issues

Conversation

@spbrogan

@spbrogan Sean Brogan (spbrogan) commented Apr 4, 2026 •

Copy link
Copy Markdown
Member

Description

Fix numerous nvme issues - see each commit.

fixes #1739, #1738, #1744

For details on how to complete these options and their meaning refer to CONTRIBUTING.md.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Host based unit tests authored to show failure.
Host based unit tests passed after changes

Integration Instructions

None. Existing module.

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Apr 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/202511@8178984). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202511    #1743   +/-   ##
=================================================
  Coverage                  ?    1.58%           
=================================================
  Files                     ?      634           
  Lines                     ?   232393           
  Branches                  ?      420           
=================================================
  Hits                      ?     3690           
  Misses                    ?   228688           
  Partials                  ?       15           
Flag Coverage Δ
MdeModulePkg 1.58% <100.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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@os-d

Copy link
Copy Markdown
Contributor

Since this is not causing an active problem, can you take this directly to edk2? We can still review it there.

@spbrogan
Sean Brogan (spbrogan) force-pushed the fix_nvme_issues branch 2 times, most recently from 73dcd7f to dec896e Compare April 4, 2026 19:04
…ate and protocol opens

Why this is a real bug:
After allocating Private via AllocateZeroPool (line ~1201) and successfully opening both gEfiDevicePathProtocolGuid and gEfiPciIoProtocolGuid BY_DRIVER, the function attempts PciIo->Attributes(EfiPciIoAttributeOperationGet, ...). If this call fails, the code executes return Status instead of goto Exit.

Trigger path:

NvmExpressDriverBindingStart is called.
OpenProtocol for DevicePath succeeds (opens BY_DRIVER).
OpenProtocol for PciIo succeeds (opens BY_DRIVER).
AllocateZeroPool for Private succeeds.
PciIo->Attributes(Get) returns an error.
return Status bypasses the Exit: label.
Why this is NOT a false positive:
The Exit: label at line ~1340 performs FreePool(Private), gBS->CloseProtocol(PciIo), and gBS->CloseProtocol(DevicePath). The direct return skips all of these. No other caller cleans up Private or closes the protocols.

Consequence:
Memory leak of NVME_CONTROLLER_PRIVATE_DATA. Two protocols remain opened BY_DRIVER on the controller handle, preventing other drivers from binding.
@makubacki Michael Kubacki (makubacki) added the type:bug Something isn't working label Apr 6, 2026
@mu-automation

mu-automation Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@mu-automation mu-automation Bot added the state:stale Has not been updated in a long time label Aug 4, 2026
@mu-automation

mu-automation Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically been closed because it did not have any activity in 60 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

@mu-automation mu-automation Bot closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:stale Has not been updated in a long time type:bug Something isn't working

Projects

None yet

5 participants