audk/EmbeddedPkg/Library
Gua Guo aeaee8944f EmbeddedPkg/Hob: Integer Overflow in CreateHob()
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4166

Fix integer overflow in various CreateHob instances.
Fixes: CVE-2022-36765

The CreateHob() function aligns the requested size to 8
performing the following operation:
```
HobLength = (UINT16)((HobLength + 0x7) & (~0x7));
```

No checks are performed to ensure this value doesn't
overflow, and could lead to CreateHob() returning a smaller
HOB than requested, which could lead to OOB HOB accesses.

Reported-by: Marc Beatove <mbeatove@google.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Abner Chang <abner.chang@amd.com>
Cc: John Mathew <john.mathews@intel.com>
Authored-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Gua Guo <gua.guo@intel.com>
2024-01-26 03:40:09 +00:00
..
AcpiLib EmbeddedPkg/AcpiLib: Fix code formatting errors 2022-10-03 18:22:03 +00:00
AndroidBootImgLib EmbeddedPkg: Allow longer android kernel command line 2023-11-30 04:58:07 +00:00
CoherentDmaLib EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DebugAgentTimerLibNull EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
DxeDtPlatformDtbLoaderLibDefault EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FdtLib EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GdbSerialDebugPortLib EmbeddedPkg/GdbSerialDebugPortLib: fix compile warning 2022-09-05 13:52:51 +00:00
GdbSerialLib EmbeddedPkg: Remove duplicated words 2022-09-05 13:52:51 +00:00
NonCoherentDmaLib EmbeddedPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
NorFlashInfoLib EmbeddedPkg/NorFlashInfoLib: Update norflash device list 2023-10-20 12:40:41 +00:00
NvVarStoreFormattedLib EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS 2019-04-29 15:34:16 +02:00
PlatformHasAcpiLib EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
PrePiExtractGuidedSectionLib EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PrePiHobLib EmbeddedPkg/Hob: Integer Overflow in CreateHob() 2024-01-26 03:40:09 +00:00
PrePiLib EmbeddedPkg/PrePiLib: Drop unused PCD PcdPrePiCpuIoSize 2023-02-04 10:55:05 +00:00
PrePiMemoryAllocationLib EmbeddedPkg/PrePiMemoryAllocationLib: Add ReallocatePool 2024-01-03 13:43:18 +00:00
TemplateRealTimeClockLib EmbeddedPkg/TemplateRealTimeClockLib: drop LibRtcVirtualNotifyEvent 2023-10-18 16:15:41 +00:00
TemplateResetSystemLib EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
TimeBaseLib EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
VirtualRealTimeClockLib EmbeddedPkg/VirtualRealTimeClockLib: drop LibRtcVirtualNotifyEvent 2023-10-18 16:15:41 +00:00