Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 9989454219e751a05bfac40605b1d22008c7bc29
      
https://github.com/tianocore/edk2/commit/9989454219e751a05bfac40605b1d22008c7bc29
  Author: Gowtham M <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    M EmulatorPkg/Library/SecPeiServicesLib/FwVol.c

  Log Message:
  -----------
  EmulatorPkg/SecPeiServicesLib: Prevent overread with available size macros

Symptom:Unsafe typecasting may lead to out‑of‑bound memory access

RootCause: FileSize, FileLength and SectionLength are declared as
UINT32 and masked with 0x00FFFFFF to store only the lower 24 bits.
Although this approach yields the correct result,
it introduces a potential risk due to unsafe typecasting and
dereferencing.

Solution: Using the predefined macro FFS_FILE_SIZE()
and SECTION_SIZE from MdePkg\Include\Pi\PiFirmwareFile.h,
which safely performs the same operation by reconstructing
the size using individual byte access.

This commit also addresses the fix for coverity issue "OVERRUN"

Cc: Sachin Ganesh <[email protected]>
Signed-off-by: Gowtham M <[email protected]>


  Commit: 3b0deb5e7941f59b0a262a4ed8a928f0d2dcb0da
      
https://github.com/tianocore/edk2/commit/3b0deb5e7941f59b0a262a4ed8a928f0d2dcb0da
  Author: Gowtham M <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    M EmbeddedPkg/Library/PrePiLib/FwVol.c

  Log Message:
  -----------
  EmbeddedPkg/PrePiLib: Prevent overread with FFS size macros

Symptom:Unsafe typecasting may lead to out‑of‑bound memory access

RootCause: FileSize and FileLength are declared as
UINT32 and masked with 0x00FFFFFF to store only the lower 24 bits.
Although this approach yields the correct result,
it introduces a potential risk due to unsafe typecasting and
dereferencing.

Solution: Using the predefined macro FFS_FILE_SIZE()
from MdePkg\Include\Pi\PiFirmwareFile.h,
which safely performs the same operation by reconstructing
the size using individual byte access.

This commit also addresses the fix for coverity isssue "OVERRUN"

Cc: Sachin Ganesh <[email protected]>
Signed-off-by: Gowtham M <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/7e0b85e03bcc...3b0deb5e7941

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to