Skip to content

[2511] NetworkPkg/UefiPxeBcDxe: Add missing Token.Context initialization#1655

Merged
makubacki merged 1 commit intomicrosoft:release/202511from
makubacki:uefipxebcdxe_pxebcmtfp_init_2511
Feb 26, 2026
Merged

[2511] NetworkPkg/UefiPxeBcDxe: Add missing Token.Context initialization#1655
makubacki merged 1 commit intomicrosoft:release/202511from
makubacki:uefipxebcdxe_pxebcmtfp_init_2511

Conversation

@makubacki
Copy link
Member

Description

Adds missing Token.Context = Private initialization in two MTFTP write-file functions. Without this, the Context field passed to the MTFTP WriteFile callback was uninitialized, which could lead to a page fault when the callback attempted to access the Private driver context. The corresponding read-file functions already set this field correctly.

This has been an issue since the initial implementation of NetworkPkg (2010).

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

How This Was Tested

Test file write to TFTP server with memory protections enabled.

Integration Instructions

  • N/A

@makubacki makubacki requested review from apop5, kuqin12 and os-d February 25, 2026 17:13
@makubacki makubacki self-assigned this Feb 25, 2026
@makubacki makubacki added the type:bug Something isn't working label Feb 25, 2026
@makubacki makubacki changed the title NetworkPkg/UefiPxeBcDxe: Add missing Token.Context initialization [2511] NetworkPkg/UefiPxeBcDxe: Add missing Token.Context initialization Feb 25, 2026
@makubacki
Copy link
Member Author

Equivalent PR into release/202502: #1656

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/202511@71462c7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             release/202511   #1655   +/-   ##
================================================
  Coverage                  ?   0.55%           
================================================
  Files                     ?     165           
  Lines                     ?   72364           
  Branches                  ?    1789           
================================================
  Hits                      ?     402           
  Misses                    ?   71955           
  Partials                  ?       7           
Flag Coverage Δ
NetworkPkg 0.55% <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.

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

@makubacki makubacki force-pushed the uefipxebcdxe_pxebcmtfp_init_2511 branch from 25b15b6 to 1f588d6 Compare February 26, 2026 02:15
@makubacki
Copy link
Member Author

Need a reapproval after rebasing.

@makubacki makubacki enabled auto-merge (squash) February 26, 2026 02:18
Adds missing `Token.Context = Private` initialization in two MTFTP
write-file functions. Without this, the `Context` field passed to the
MTFTP `WriteFile` callback was uninitialized, which could lead to
a page fault when the callback attempted to access the `Private`
driver context. The corresponding read-file functions already set this
field correctly.

This has been an issue since the initial implementation of
NetworkPkg (2010).

Co-authored-by: Wenbo Hou <wenbhou@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki force-pushed the uefipxebcdxe_pxebcmtfp_init_2511 branch from 1f588d6 to e1c758d Compare February 26, 2026 16:36
@makubacki makubacki merged commit c12b9aa into microsoft:release/202511 Feb 26, 2026
51 checks passed
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.

5 participants