From da2af2ee9c50d3d2ece764c0efdc4bf4cb8ad6ff Mon Sep 17 00:00:00 2001 From: Michael Kubacki Date: Wed, 26 Feb 2025 20:48:13 -0500 Subject: [PATCH] MdeModulePkg/SmmCorePerformanceLib: Remove offset from comm buffer dest space A check validates that if perf records are being written to the comm buffer (not a buffer pointed to from the comm buffer) that enough space is available after the `SMM_BOOT_RECORD_COMMUNICATE` header in the comm buffer for the boot record size requested. That check currently removes the offset from the boot record size but that is not needed since the offset is applied to the source buffer and the record size is what is copied into the desintation (comm buffer). Signed-off-by: Michael Kubacki --- .../Library/SmmCorePerformanceLib/MmCorePerformanceLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/MmCorePerformanceLib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/MmCorePerformanceLib.c index 3dc1c48e26..4ef26f66b7 100644 --- a/MdeModulePkg/Library/SmmCorePerformanceLib/MmCorePerformanceLib.c +++ b/MdeModulePkg/Library/SmmCorePerformanceLib/MmCorePerformanceLib.c @@ -877,7 +877,7 @@ FpdtSmiHandler ( } // Note: Comm size passed to this handler already has OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data) removed. - if ((SmmCommData->BootRecordData == NULL) && (BootRecordSize - BootRecordOffset > TempCommBufferSize - sizeof (SMM_BOOT_RECORD_COMMUNICATE))) { + if ((SmmCommData->BootRecordData == NULL) && (BootRecordSize > TempCommBufferSize - sizeof (SMM_BOOT_RECORD_COMMUNICATE))) { Status = EFI_BUFFER_TOO_SMALL; break; }