audk/OvmfPkg/Library
Martin Radev ca31888271 OvmfPkg/X86QemuLoadImageLib: Handle allocation failure for CommandLine
The CommandLine and InitrdData may be set to NULL if the provided
size is too large. Because the zero page is mapped, this would not
cause an immediate crash but can lead to memory corruption instead.
This patch just adds validation and returns error if either allocation
has failed.

Signed-off-by: Martin Radev <martin.b.radev@gmail.com>
Message-Id: <YFPJsaGzVWQxoEU4@martin-ThinkPad-T440p>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
[lersek@redhat.com: drop unnecessary empty line from code; remove personal
 (hence likely unstable) repo reference from commit message]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2021-03-19 18:13:51 +00:00
..
AcpiTimerLib OvmfPkg: Add bhyve support into AcpiTimerLib 2020-04-30 13:46:11 +00:00
BaseMemEncryptSevLib OvfmPkg/VmgExitLib: Validate #VC MMIO is to un-encrypted memory 2021-01-07 19:34:39 +00:00
BasePciCapLib OvmfPkg/BasePciCapLib: suppress invalid "nullptr deref" warning 2019-04-18 16:06:04 +02:00
BasePciCapPciSegmentLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
BhyveFwCtlLib OvmfPkg: Fix style of BhyveFwCtlLib.inf 2020-11-30 17:49:39 +00:00
DxePciLibI440FxQ35 OvmfPkg/Qemu: Fix various typos 2020-02-10 22:30:07 +00:00
EmuVariableFvbLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
GenericQemuLoadImageLib OvmfPkg/GenericQemuLoadImageLib: log "Not Found" at INFO level 2020-06-10 07:55:55 +00:00
LoadLinuxLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
LockBoxLib OvmfPkg: strip trailing whitespace 2019-10-04 11:18:32 +01:00
NvVarsFileLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
PciHostBridgeLib OvmfPkg/PciHostBridgeUtilityLib: Extend GetRootBridges() with BusMin/BusMax 2021-01-20 16:14:20 +00:00
PciHostBridgeUtilityLib OvmfPkg/PciHostBridgeUtilityLib: Extend GetRootBridges() with BusMin/BusMax 2021-01-20 16:14:20 +00:00
PlatformBmPrintScLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
PlatformBootManagerLib OvmfPkg/PlatformBootManagerLib: fix PCI interrupt link (LNKx) 2020-12-18 12:51:37 +00:00
PlatformBootManagerLibBhyve OvmfPkg/Bhyve: Add support for the AMD host bridge 2020-11-27 16:48:47 +00:00
PlatformBootManagerLibGrub OvmfPkg/AmdSev: add Grub Firmware Volume Package 2020-12-14 19:56:18 +00:00
PlatformDebugLibIoPort OvmfPkg/PlatformDebugLibIoPort: Introduce a Nocheck variant 2020-04-28 21:12:01 +00:00
PlatformFvbLibNull OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
PlatformHasIoMmuLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
PlatformSecureLib OvmfPkg: strip trailing whitespace 2019-10-04 11:18:32 +01:00
PxeBcPcdProducerLib OvmfPkg: control PXEv4 / PXEv6 boot support from the QEMU command line 2020-04-28 22:37:35 +00:00
QemuBootOrderLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
QemuFwCfgLib OvmfPkg: Add QemuFwCfgLibNull 2020-05-05 16:57:57 +00:00
QemuFwCfgS3Lib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
QemuFwCfgSimpleParserLib OvmfPkg: introduce QemuFwCfgSimpleParserLib 2020-04-28 22:37:35 +00:00
ResetSystemLib OvmfPkg: Add BaseResetSystemLibBhyve 2020-05-05 19:40:40 +00:00
SerializeVariablesLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
SmbiosVersionLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
SmmCpuFeaturesLib OvmfPkg/SmmCpuFeaturesLib: call CPU hot-eject handler 2021-03-16 13:21:46 +00:00
SmmCpuPlatformHookLibQemu OvmfPkg: enable SMM Monarch Election in PiSmmCpuDxeSmm 2020-03-04 12:22:07 +00:00
Tcg2PhysicalPresenceLibNull OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
Tcg2PhysicalPresenceLibQemu OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
TlsAuthConfigLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
UefiPciCapPciIoLib OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00
VirtioLib OvmfPkg/Virtio: Fix few typos 2020-02-10 22:30:07 +00:00
VirtioMmioDeviceLib OvmfPkg: drop redundant VendorID check in VirtioMmioDeviceLib 2020-09-17 12:01:11 +00:00
VmgExitLib OvfmPkg/VmgExitLib: Validate #VC MMIO is to un-encrypted memory 2021-01-07 19:34:39 +00:00
X86QemuLoadImageLib OvmfPkg/X86QemuLoadImageLib: Handle allocation failure for CommandLine 2021-03-19 18:13:51 +00:00
XenConsoleSerialPortLib OvmfPkg/Xen: Fix various typos 2020-02-10 22:30:07 +00:00
XenHypercallLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
XenIoMmioLib OvmfPkg: replace old EFI_D_ debug levels with new DEBUG_ ones 2020-04-30 13:01:16 +00:00
XenPlatformLib OvmfPkg/XenPlatformLib: Cache result for XenDetected 2019-08-21 18:03:49 +02:00
XenRealTimeClockLib OvmfPkg: Move XenRealTimeClockLib from ArmVirtPkg 2019-08-21 18:03:50 +02:00