public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray via groups.io" <ray.ni=intel.com@groups.io>
To: "kuqin@microsoft.com" <kuqin@microsoft.com>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Ni, Ray" <ray.ni@intel.com>
Subject: [edk2-devel] A bug in the SmmCommunication V3 logic
Date: Fri, 18 Apr 2025 06:44:51 +0000	[thread overview]
Message-ID: <MN6PR11MB8244F17EEB897171F69C40E18CBF2@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

Hi Qin,
I think there is a bug in the SmmCommunication protocol implementation.

All 3 communication protocol calls go to the same communicate() function that tests the HeaderGuid against the V3 GUID.
But when the call is from runtime, reading the HeaderGuid using the physical address of communication buffer would cause page fault. The virtual address should be used.
The bug was not there without your patch because the communicate routines happened not to read any bytes from the communication buffer but simply pass the address to SMM. SMM expects the physical address because the virtual-to-physical mapping in SMM is identical.

The bug exists in both the SmmIpl.c in MdeModulePkg and the MmCommunicationDxe.c in StandaloneMmPkg.
The bug would cause OS boot failure if there is any communication protocol invocation after ExitBootService.

I guess the bug might not be there in your first version of patch, but was introduced when I asked you to consolidate the logic together.

Can you kindly reproduce it locally and send out a fix after confirming?

Thanks,
Ray


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121264): https://edk2.groups.io/g/devel/message/121264
Mute This Topic: https://groups.io/mt/112327494/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 4930 bytes --]

             reply	other threads:[~2025-04-18  6:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-18  6:44 Ni, Ray via groups.io [this message]
2025-04-18  7:30 ` [edk2-devel] A bug in the SmmCommunication V3 logic Kun Qin via groups.io
2025-04-18 15:58   ` Michael D Kinney via groups.io
2025-04-18 18:25     ` Kun Qin via groups.io
2025-04-18 21:33       ` Michael D Kinney via groups.io
2025-04-18 22:17         ` Kun Qin via groups.io
2025-04-18 22:22           ` Michael D Kinney via groups.io
2025-04-18 22:34             ` Kun Qin via groups.io
2025-04-18 22:37               ` Michael D Kinney via groups.io
2025-04-18 22:46                 ` Kun Qin via groups.io
2025-04-19  6:04                   ` Michael D Kinney via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN6PR11MB8244F17EEB897171F69C40E18CBF2@MN6PR11MB8244.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox