audk/BaseTools/Source/Python/AutoGen
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
..
AutoGen.py BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
AutoGenWorker.py BaseTools: Move gPlatformFinalPcd to Datapipe and optimize size 2022-04-22 13:55:16 +00:00
BuildEngine.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
DataPipe.py BaseTools: Move gPlatformFinalPcd to Datapipe and optimize size 2022-04-22 13:55:16 +00:00
GenC.py BaseTools: Update Stack Cookie Logic 2024-09-13 03:58:46 +00:00
GenDepex.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
GenMake.py BaseTools: GenMake: FIx missing logs from GenMake.py 2024-09-02 06:32:06 +00:00
GenPcdDb.py BaseTools: Fix the improper error logging 2021-01-06 02:57:38 +00:00
GenVar.py BaseTools: Fix wrong variable header size 2022-01-13 09:35:35 +00:00
IdfClassObject.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
IncludesAutoGen.py BaseTools: Resolve index out of range errors. 2020-11-19 02:22:57 +00:00
InfSectionParser.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
ModuleAutoGen.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
ModuleAutoGenHelper.py BaseTools: Fix New Target/ToolChain/Arch in DSC [BuildOptions] issues 2021-05-03 18:16:23 +00:00
PlatformAutoGen.py BaseTools: Remove Duplicate sets of SkuName and SkuId from allskuset 2024-02-08 19:27:18 +00:00
StrGather.py BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
UniClassObject.py python: Replace distutils.utils.split_quotes with shlex.split 2021-08-02 03:09:59 +00:00
ValidCheckingInfoObject.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
WorkspaceAutoGen.py BaseTools: Optimize GenerateByteArrayValue and CollectPlatformGuids APIs 2024-02-08 04:08:38 +00:00
__init__.py BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00