Skip to content

[Rebase & FF] Adding MM communication buffer validation - #1846

Merged
kuqin12 merged 6 commits into
microsoft:release/202511from
kuqin12:mm_comm
Aug 21, 2026
Merged

[Rebase & FF] Adding MM communication buffer validation#1846
kuqin12 merged 6 commits into
microsoft:release/202511from
kuqin12:mm_comm

Conversation

@kuqin12

@kuqin12 kuqin12 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

This change adds a few validation before using the derived buffer size from message length.

However, note that the buffer size is not used directly due to a check after that. Thus the MM communication agent or the core in MM will not consume the value directly. But this would cause the MM handler to potentially receive a huge message in length.

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

How This Was Tested

This is tested on QEMU ARM Virt platform and booted to Windows desktop.

Integration Instructions

N/A

@kuqin12
kuqin12 marked this pull request as draft July 10, 2026 23:47
@mu-automation

mu-automation Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

⏩ QEMU Validation Skipped

The PR was merged before validation completed.

This comment was automatically generated by the Mu QEMU PR Validation workflow.

@kuqin12
kuqin12 force-pushed the mm_comm branch 5 times, most recently from 6d3b895 to 48dff23 Compare August 4, 2026 21:48
@kuqin12
kuqin12 marked this pull request as ready for review August 4, 2026 21:56
@codecov-commenter

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

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 1.75439% with 56 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release/202511@762a65d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...kg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c 0.00% 55 Missing ⚠️
...kg/Drivers/MmCommunicationDxe/MmCommunicationDxe.c 50.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             release/202511   #1846   +/-   ##
================================================
  Coverage                  ?   0.50%           
================================================
  Files                     ?      30           
  Lines                     ?    5579           
  Branches                  ?      31           
================================================
  Hits                      ?      28           
  Misses                    ?    5551           
  Partials                  ?       0           
Flag Coverage Δ
StandaloneMmPkg 0.50% <1.75%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@kuqin12

kuqin12 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

The platform validation is failed due to override hash failure.

Comment thread StandaloneMmPkg/Core/StandaloneMmCore.c Outdated
Comment thread StandaloneMmPkg/Core/StandaloneMmCore.c Outdated
Comment thread ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
Comment thread StandaloneMmPkg/Core/StandaloneMmCore.c Outdated
Comment thread StandaloneMmPkg/Core/StandaloneMmCore.c Outdated
@kuqin12
kuqin12 force-pushed the mm_comm branch 3 times, most recently from f4e8ea1 to 9a90186 Compare August 13, 2026 22:50
@kuqin12
kuqin12 enabled auto-merge (rebase) August 21, 2026 20:04
…ions

This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication message length before using.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
…ions

This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
…ic operations

This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This change adds the SafeIntLib to communication input routine to
validate the incoming MM communication buffer length before using.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
This change validates the returned MM communication content against the
caller supplied buffer size before copying.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
@kuqin12
kuqin12 merged commit dc5a299 into microsoft:release/202511 Aug 21, 2026
58 checks passed
kuqin12 added a commit to microsoft/mu_feature_mm_supv that referenced this pull request Aug 22, 2026
## Description

BASECORE has updated implementation of `StandaloneMmCore` to harden the
incoming buffer validation
microsoft/mu_basecore#1846.

This was done in our core in #666. So only the override tags are
updated.

For details on how to complete these options and their meaning refer to
[CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

This was tested locally and booted to OS desktop.

## Integration Instructions

Use commits from basecore later than
[dc5a299b61611f76002dac5c5e90ad4bda95ee11](microsoft/mu_basecore@dc5a299).
kuqin12 added a commit to kuqin12/mu_feature_mm_supv that referenced this pull request Aug 27, 2026
## Description

BASECORE has updated implementation of `StandaloneMmCore` to harden the
incoming buffer validation
microsoft/mu_basecore#1846.

This was done in our core in microsoft#666. So only the override tags are
updated.

For details on how to complete these options and their meaning refer to
[CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

This was tested locally and booted to OS desktop.

## Integration Instructions

Use commits from basecore later than
[dc5a299b61611f76002dac5c5e90ad4bda95ee11](microsoft/mu_basecore@dc5a299).
kuqin12 added a commit to microsoft/mu_feature_mm_supv that referenced this pull request Aug 27, 2026
## Description

BASECORE has updated implementation of `StandaloneMmCore` to harden the
incoming buffer validation
microsoft/mu_basecore#1846.

This was done in our core in #666. So only the override tags are
updated.

For details on how to complete these options and their meaning refer to
[CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

This was tested locally and booted to OS desktop.

## Integration Instructions

Use commits from basecore later than
[dc5a299b61611f76002dac5c5e90ad4bda95ee11](microsoft/mu_basecore@dc5a299).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants