Skip to content

Commit

Permalink
Add StackCheckLib Instances to Platform DSC Files (#252)
Browse files Browse the repository at this point in the history
## Description

An instance of StackCheckLib must be in each DSC to accommodate
-fstack-protector and /GS flags.

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Tested in pipelines

## Integration Instructions

N/A
  • Loading branch information
TaylorBeebe committed Mar 2, 2024
1 parent c15f0af commit 5af0370
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
3 changes: 2 additions & 1 deletion EmbeddedPkg/EmbeddedPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support

DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
Expand Down Expand Up @@ -133,7 +134,7 @@
NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf # MU_CHANGE

# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
# NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE

# ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf # MU_CHANGE

Expand Down
3 changes: 2 additions & 1 deletion FatPkg/FatPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support

UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
Expand All @@ -60,7 +61,7 @@
[LibraryClasses.ARM, LibraryClasses.AARCH64]
# NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf # MU_CHANGE
NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf # MU_CHANGE
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
# NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE

###################################################################################################
#
Expand Down
3 changes: 2 additions & 1 deletion FmpDevicePkg/FmpDevicePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support

[LibraryClasses.ARM, LibraryClasses.AARCH64]
#
Expand All @@ -77,7 +78,7 @@
NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf # MU_CHANGE

# Add support for stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
# NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE

# [LibraryClasses.ARM] # MU_CHANGE
# ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf # MU_CHANGE
Expand Down
14 changes: 4 additions & 10 deletions PrmPkg/PrmPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,16 @@
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf

# MU_CHANGE [BEGIN] - Add Stack Cookie Support
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf # MU_CHANGE - CodeQL change
[LibraryClasses.X64]
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
NULL|MdePkg/Library/StackCheckLib/StackCheckLib.inf
StackCheckFailureLib|MdePkg/Library/StackCheckFailureLibNull/StackCheckFailureLibNull.inf
# MU_CHANGE [END] - Add Stack Cookie Support
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf # MU_CHANGE - CodeQL change
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support

[LibraryClasses.IA32, LibraryClasses.X64]
MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf

[LibraryClasses.AARCH64]
#NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
# NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE

[LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
#
Expand Down Expand Up @@ -162,7 +156,7 @@ SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf # MU_CHANGE - CodeQL
MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf

# Add support for GCC stack protector
MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
# MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE

[BuildOptions]
# Force deprecated interfaces off
Expand Down
3 changes: 2 additions & 1 deletion SecurityPkg/SecurityPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
SourceDebugEnabledLib|SourceLevelDebugPkg/Library/SourceDebugEnabled/SourceDebugEnabledLib.inf ## MS_CHANGE_?
Hash2CryptoLib|SecurityPkg/Library/BaseHash2CryptoLibNull/BaseHash2CryptoLibNull.inf ## MU_CHANGE
SafeIntLib |MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf ## MU_CHANGE - CodeQL change
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support

[LibraryClasses.X64, LibraryClasses.IA32]
Tcg2PreUefiEventLogLib|SecurityPkg/Library/Tcg2PreUefiEventLogLibNull/Tcg2PreUefiEventLogLibNull.inf ## MU_CHANGE
Expand All @@ -96,7 +97,7 @@
NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf # MU_CHANGE

# Add support for GCC stack protector
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
# NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf # MU_CHANGE

# ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf # MU_CHANGE
ArmTrngLib|MdePkg/Library/BaseArmTrngLibNull/BaseArmTrngLibNull.inf
Expand Down
1 change: 1 addition & 0 deletions SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf
##MSCHANGE Begin
SourceDebugEnabledLib|SourceLevelDebugPkg/Library/SourceDebugEnabled/SourceDebugEnabledLib.inf ## MS_CHANGE_?
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf # MU_CHANGE: /GS and -fstack-protector support
##MSCHANGE End

!ifdef $(SOURCE_DEBUG_USE_USB)
Expand Down

0 comments on commit 5af0370

Please sign in to comment.