Skip to content

Commit da2af2e

Browse files
committed
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 <[email protected]>
1 parent 0c709b8 commit da2af2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MdeModulePkg/Library/SmmCorePerformanceLib/MmCorePerformanceLib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ FpdtSmiHandler (
877877
}
878878

879879
// Note: Comm size passed to this handler already has OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data) removed.
880-
if ((SmmCommData->BootRecordData == NULL) && (BootRecordSize - BootRecordOffset > TempCommBufferSize - sizeof (SMM_BOOT_RECORD_COMMUNICATE))) {
880+
if ((SmmCommData->BootRecordData == NULL) && (BootRecordSize > TempCommBufferSize - sizeof (SMM_BOOT_RECORD_COMMUNICATE))) {
881881
Status = EFI_BUFFER_TOO_SMALL;
882882
break;
883883
}

0 commit comments

Comments
 (0)