audk/EmbeddedPkg
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
..
Application EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Drivers EmbeddedPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
EmbeddedMonotonicCounter EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
GdbStub EmbeddedPkg: Remove duplicated words 2022-09-05 13:52:51 +00:00
Include EmbeddedPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent from lib class 2023-10-18 16:15:41 +00:00
Library EmbeddedPkg/Hob: Integer Overflow in CreateHob() 2024-01-26 03:40:09 +00:00
MetronomeDxe EmbeddedPkg/MetronomeDxe: Update outdated lower bound comment 2022-11-29 19:39:43 +00:00
RealTimeClockRuntimeDxe EmbeddedPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
ResetRuntimeDxe EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Scripts/LauterbachT32 EmbeddedPkg: convert Lauterbach README.txt to 7-bit safe Readme.md 2019-10-04 11:18:22 +01:00
SimpleTextInOutSerial EmbeddedPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Test/Mock EmbeddedPkg: Add DtPlatformLoaderLib gmock support 2024-01-03 13:43:18 +00:00
Universal/MmcDxe EmbeddedPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
EmbeddedPkg.ci.yaml EmbeddedPkg: Add host based dependency to ci 2024-01-03 13:43:18 +00:00
EmbeddedPkg.dec EmbeddedPkg: Add DtPlatformLoaderLib gmock support 2024-01-03 13:43:18 +00:00
EmbeddedPkg.dsc EmbeddedPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00