Skip to content

Commit

Permalink
Remove StackCheckLibNull From MdeLibs.dsc.inc
Browse files Browse the repository at this point in the history
Commit ac43bba added StackCheckLibNull
to MdeLibs.dsc.inc per review requests on the PR:
#5957 (comment)
#5957 (comment).

The PR was adapted to move specifying StackCheckLibNull in every DSC
to MdeLibs.dsc.inc. However, while this works, it does not allow for
a platform to use one of the other StackCheckLibs (such as
StackCheckLibStaticInit) because we get a linker error by having the
compiler defined stack cookie variables defined more than once (once
from StackCheckLibNull in MdeLibs.dsc.inc and the other in the actual
StackCheckLib implementation). Every platform must include MdeLibs.dsc.inc
and there is no way to override a NULL library class. So, we must go
back to the original solution and include StackCheckLib in each
DSC with whatever the preferred version is.

In order to avoid build breaks, this PR updates all DSCs and relevant
dsc.incs to add StackCheckLibNull for the CI build. It also removes
it from MdeLibs.dsc.inc. As per the original PR, StackCheckLib cannot
be generically linked against all SEC modules, on some IA32/X64
SEC modules, they do not include _ModuleEntryPoint, which is required
when linking against a module.

This has been tested that StackCheckLibStaticInit can be used in a
package's CI instead of the null version now.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <[email protected]>
  • Loading branch information
os-d committed Sep 13, 2024
1 parent 273f43c commit 443d8a6
Show file tree
Hide file tree
Showing 35 changed files with 90 additions and 70 deletions.
3 changes: 1 addition & 2 deletions ArmPkg/ArmPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@

OemMiscLib|ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf

[LibraryClasses.common.SEC]
# ARM platforms have SEC modules with standard entry points, so we can generically link StackCheckLib
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM]
Expand Down
3 changes: 3 additions & 0 deletions ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[Components.common]
ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
6 changes: 3 additions & 3 deletions ArmVirtPkg/ArmVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@

ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.SEC]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
Expand All @@ -182,9 +185,6 @@
DebugLib|ArmVirtPkg/Library/DebugLibFdtPL011Uart/DebugLibFdtPL011UartFlash.inf
!endif

# ARM platforms have SEC modules with standard entry points, so we can generically link StackCheckLib
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEI_CORE]
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
Expand Down
5 changes: 3 additions & 2 deletions CryptoPkg/CryptoPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64]
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf

Expand All @@ -124,8 +127,6 @@
[LibraryClasses.common.SEC]
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf
# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM]
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
Expand Down
3 changes: 3 additions & 0 deletions CryptoPkg/CryptoPkgMbedTls.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM]
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
Expand Down
3 changes: 1 addition & 2 deletions DynamicTablesPkg/DynamicTablesPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.ARM, LibraryClasses.AARCH64]
Expand Down
5 changes: 3 additions & 2 deletions EmbeddedPkg/EmbeddedPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@

TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
Expand All @@ -122,8 +125,6 @@

[LibraryClasses.common.SEC]
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.ARM, LibraryClasses.AARCH64]
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
Expand Down
5 changes: 3 additions & 2 deletions EmulatorPkg/EmulatorPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
!endif

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.SEC]
PeiServicesLib|EmulatorPkg/Library/SecPeiServicesLib/SecPeiServicesLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
Expand All @@ -151,8 +154,6 @@
PpiListLib|EmulatorPkg/Library/SecPpiListLib/SecPpiListLib.inf
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
TimerLib|EmulatorPkg/Library/PeiTimerLib/PeiTimerLib.inf
# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.USER_DEFINED, LibraryClasses.common.BASE]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
Expand Down
3 changes: 1 addition & 2 deletions FatPkg/FatPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM]
Expand Down
3 changes: 1 addition & 2 deletions FmpDevicePkg/FmpDevicePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.ARM]
Expand Down
3 changes: 1 addition & 2 deletions IntelFsp2Pkg/IntelFsp2Pkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
FspSecPlatformLib|IntelFsp2Pkg/Library/SecFspSecPlatformLibNull/SecFspSecPlatformLibNull.inf
FspMultiPhaseLib|IntelFsp2Pkg/Library/BaseFspMultiPhaseLib/BaseFspMultiPhaseLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM, LibraryClasses.common.SEC]
Expand Down
5 changes: 2 additions & 3 deletions IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@

Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM,LibraryClasses.common.PEI_CORE]
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
Expand Down
3 changes: 1 addition & 2 deletions MdeModulePkg/MdeModulePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@
IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf
SpiHcPlatformLib|MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.EBC.PEIM]
Expand Down
6 changes: 0 additions & 6 deletions MdePkg/MdeLibs.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,3 @@
# definitions for the intrinsic functions.
#
NULL|MdePkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

# Stack Cookies cannot be generically applied to SEC modules because they may not define _ModuleEntryPoint and when we
# link a library in, we have to be able to define the entry point. SEC modules that do define _ModuleEntryPoint can
# apply a library class override to get StackCheckLibNull.inf
[LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM, LibraryClasses.common.DXE_CORE, LibraryClasses.common.SMM_CORE, LibraryClasses.common.MM_CORE_STANDALONE, LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_SMM_DRIVER, LibraryClasses.common.MM_STANDALONE, LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
3 changes: 3 additions & 0 deletions MdePkg/MdePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
[LibraryClasses]
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[Components]
MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
Expand Down
3 changes: 1 addition & 2 deletions NetworkPkg/NetworkPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.UEFI_DRIVER]
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/AmdSev/AmdSevX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@
!include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc
!include OvmfPkg/Include/Dsc/ShellLibs.dsc.inc

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common]
AmdSvsmLib|OvmfPkg/Library/AmdSvsmLib/AmdSvsmLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
Expand Down Expand Up @@ -232,9 +235,6 @@
CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEI_CORE]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/Bhyve/BhyveX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@

!include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common]
AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
Expand All @@ -256,9 +259,6 @@
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEI_CORE]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/CloudHv/CloudHvX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@

!include OvmfPkg/Include/Dsc/OvmfTpmLibs.dsc.inc

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common]
AmdSvsmLib|OvmfPkg/Library/AmdSvsmLib/AmdSvsmLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
Expand Down Expand Up @@ -269,9 +272,6 @@
CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEI_CORE]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
Expand Down
8 changes: 8 additions & 0 deletions OvmfPkg/Include/Dsc/OvmfPkg.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

#
# Stack Cookies cannot be generically applied to SEC modules because they may not define _ModuleEntryPoint and when we
# link a library in, we have to be able to define the entry point. SEC modules that do define _ModuleEntryPoint can
# apply a library class override to get StackCheckLibNull.inf
#
[LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM, LibraryClasses.common.DXE_CORE, LibraryClasses.common.SMM_CORE, LibraryClasses.common.MM_CORE_STANDALONE, LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_SMM_DRIVER, LibraryClasses.common.MM_STANDALONE, LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[PcdsFixedAtBuild.common]
!ifdef $(FIRMWARE_VER)
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/IntelTdx/IntelTdxX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@

!include OvmfPkg/Include/Dsc/ShellLibs.dsc.inc

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common]
AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
Expand Down Expand Up @@ -240,9 +243,6 @@
PeilessStartupLib|OvmfPkg/Library/PeilessStartupLib/PeilessStartupLib.inf
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.DXE_CORE]
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
Expand Down
8 changes: 5 additions & 3 deletions OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@
VariableFlashInfoLib | MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
VirtNorFlashPlatformLib | OvmfPkg/Library/FdtNorFlashQemuLib/FdtNorFlashQemuLib.inf

#
# Provides Stack Cookie Implementation
#
NULL | MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.SEC]
PcdLib | MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
ReportStatusCodeLib | MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
Expand All @@ -194,9 +199,6 @@
PlatformHookLib | OvmfPkg/LoongArchVirt/Library/Fdt16550SerialPortHookLib/EarlyFdt16550SerialPortHookLib.inf
CpuExceptionHandlerLib | UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL | MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEI_CORE]
PcdLib | MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
HobLib | MdePkg/Library/PeiHobLib/PeiHobLib.inf
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/Microvm/MicrovmX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@

!include OvmfPkg/Include/Dsc/ShellLibs.dsc.inc

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common]
AmdSvsmLib|OvmfPkg/Library/AmdSvsmLib/AmdSvsmLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
Expand Down Expand Up @@ -277,9 +280,6 @@
CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf
MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEI_CORE]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
Expand Down
8 changes: 8 additions & 0 deletions OvmfPkg/OvmfXen.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@
CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
TdxLib|MdePkg/Library/TdxLib/TdxLib.inf

#
# Stack Cookies cannot be generically applied to SEC modules here because not all define _ModuleEntryPoint and when we
# link a library in, we have to be able to define the entry point. SEC modules that do define _ModuleEntryPoint can
# apply a library class override to get StackCheckLibNull.inf
#
[LibraryClasses.common.PEIM, LibraryClasses.common.PEI_CORE, LibraryClasses.common.DXE_CORE, LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.SEC]
QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
!ifndef $(DEBUG_ON_HYPERVISOR_CONSOLE)
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf

# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.SEC]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
Expand All @@ -152,9 +155,6 @@
PrePiHobListPointerLib|OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.DXE_CORE]
PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
Expand Down
3 changes: 1 addition & 2 deletions PcAtChipsetPkg/PcAtChipsetPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[Components]
Expand Down
3 changes: 1 addition & 2 deletions PrmPkg/PrmPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.IA32, LibraryClasses.X64]
Expand Down
3 changes: 1 addition & 2 deletions RedfishPkg/RedfishPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIpmiCommandLibNull.inf

# StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules
[LibraryClasses.common.SEC]
# Provides Stack Cookie Implementation
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.ARM, LibraryClasses.AARCH64]
Expand Down
Loading

0 comments on commit 443d8a6

Please sign in to comment.