audk/BaseTools/Source/Python/Common
Taylor Beebe cac0955658 BaseTools: Update Stack Cookie Logic
This patch updates the GenC logic to generate a random stack cookie value
for the stack check libraries. These random values improve security
for modules which cannot update the global intrinsics.

If the stack cookie value is randomized in the AutoGen.h file each
build, the build system will determine the module/library must be
rebuilt causing effectively a clean build every time. This also makes
binary reproducibility impossible.

This patch updates the early build scripts to create 32 and 64-bit JSON
files in the build output directory which each contain 100 randomized
stack cookie values for each bitwidth. If the JSON files are already
present, then they are not recreated which allows them to be stored and
moved to other builds for binary reproducibility. Because they are in
the build directory, a clean build will cause the values to be
regenerated.

The logic which creates AutoGen.h will read these JSON files and use a
hash of the module GUID (the hash seed is fixed in Basetools) to index
into the array of stack cookie values for the module bitwidth. This
model is necessary because there isn't thread-consistent data so we
cannot use a locking mechanism to ensure only one thread is writing to
the stack cookie files at a time. With this model, the build threads
only need to read from the files.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-13 03:58:46 +00:00
..
Edk2 BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Uefi BaseTools/FmpCapsuleHeader.py: Explain error when throwing exceptions 2024-07-05 19:33:50 +00:00
BuildToolError.py BaseTools:Add the spare space FV image size checker 2020-04-23 01:29:34 +00:00
BuildVersion.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
DataType.py BaseTools: Updated build tools to support new LoongArch. 2022-10-14 02:16:33 +00:00
EdkLogger.py BaseTools: Enable block queue log agent. 2019-08-09 23:15:55 +08:00
Expression.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
GlobalData.py BaseTools: Update Stack Cookie Logic 2024-09-13 03:58:46 +00:00
LongFilePathOs.py BaseTools:Introduce CopyFileOnChange() function to copy cache files 2019-06-17 17:00:46 +08:00
LongFilePathOsPath.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
LongFilePathSupport.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Misc.py BaseTools: Fix raw strings containing valid escape characters 2024-01-10 13:54:01 +00:00
MultipleWorkspace.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Parsing.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
RangeExpression.py BaseTools:change some incorrect parameter defaults 2019-09-17 10:18:51 +08:00
StringUtils.py BaseTools:change some incorrect parameter defaults 2019-09-17 10:18:51 +08:00
TargetTxtClassObject.py BaseTools:Fix GenFds issue for BuildOption replace GenFdsOption 2020-01-13 02:08:46 +00:00
ToolDefClassObject.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
VariableAttributes.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
VpdInfoFile.py BaseTools: Correct BPDG tool error prints 2022-10-19 06:32:07 +00:00
__init__.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
caching.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00