Skip to content

Commit

Permalink
MdeModulePkg/SmmCorePerformanceLib: Remove offset from comm buffer de…
Browse files Browse the repository at this point in the history
…st 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]>
  • Loading branch information
makubacki committed Feb 27, 2025
1 parent 0c709b8 commit da2af2e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit da2af2e

Please sign in to comment.