edk2/SecurityPkg
Doug Flick bfb1a45eec SecurityPkg: SecureBootVariableLib: Prevent Invalid DBX
This commit adds the ability to skip the setting the Dbx variable if
the Default being provided is less than the size of the
EFI_SIGNATURE_LIST structure. This is to prevent the
setting of an invalid DBX which would cause the system to fail to boot.

Additionally, this can be used to signal that setting the DBX
should leave DBX undefined for Platforms that want to let the OS
be the sole servicer of the DBX.

Breakdown of the math is as follows:

1. **`sizeof(EFI_SIGNATURE_LIST)`**:
   - This is the size of the `EFI_SIGNATURE_LIST` structure itself,
   which includes:
     - `EFI_GUID SignatureType` (16 bytes)
     - `UINT32 SignatureListSize` (4 bytes)
     - `UINT32 SignatureHeaderSize` (4 bytes)
     - `UINT32 SignatureSize` (4 bytes)
   - Total: `16 + 4 + 4 + 4 = 28 bytes`

2. **`SignatureHeaderSize`**:
   - This is the size of the optional signature header. If no header is
   provided, this value is `0`.

3. **`SignatureSize`**:
   - This is the size of each `EFI_SIGNATURE_DATA` entry. For an empty
   list, this value is `0`.

The total size of an empty `EFI_SIGNATURE_LIST` is:
```c
sizeof(EFI_SIGNATURE_LIST) + SignatureHeaderSize
```

1. **No Signature Header**:
   - If `SignatureHeaderSize = 0`, the size is:
     ```c
     28 + 0 = 28 bytes
     ```

2. **With a Signature Header**:
   - If `SignatureHeaderSize = 16` (example size for a header), the
   size is:
     ```c
     28 + 16 = 44 bytes
     ```

- **Minimum Size**: `28 bytes` (if `SignatureHeaderSize = 0`).
- **Additional Size**: Add the value of `SignatureHeaderSize` if a
header is included.

Signed-off-by: Doug Flick <dougflick@microsoft.com>
2025-04-17 05:37:37 +00:00
..
DeviceSecurity SecurityPkg: Update libspdm 2024-11-26 02:15:06 +00:00
EnrollFromDefaultKeysApp SecurityPkg: Secure Boot Drivers: Added common header files 2022-07-07 01:07:00 +00:00
FvReportPei SecurityPkg: Optimization by moving PeiServicesLocatePpi outside loop 2024-09-03 05:02:41 +00:00
Hash2DxeCrypto SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HddPassword Securitypkg/hddpassword: Update HddPasswordDxeInit to use Variable Policy 2023-05-08 11:39:32 +00:00
Include SecurityPkg/Ppi: Add gEdkiiCcPpi for CC Measurement in PEI phase 2024-12-10 02:09:29 +00:00
Library SecurityPkg: SecureBootVariableLib: Prevent Invalid DBX 2025-04-17 05:37:37 +00:00
Pkcs7Verify/Pkcs7VerifyDxe SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RandomNumberGenerator SecurityPkg: Add RngPei 2025-02-06 20:29:15 +00:00
Tcg SecurityPkg/OpalPassword: fix HiiOpCodeHandle leak on error path 2024-12-06 17:13:17 +00:00
Test SecurityPkg: DxeTpmMeasureBootLib: SECURITY PATCH 4117 - CVE 2022-36763 2024-01-16 07:56:38 +00:00
VariableAuthenticated SecurityPkg: Improving SecureBootConfigImpl:HashPeImageByType () logic 2025-04-09 00:13:21 +00:00
SecurityFixes.yaml SecurityPkg: Update SecurityFixes.yaml for CVE-2024-38797 2025-04-09 00:13:21 +00:00
SecurityPkg.ci.yaml SecurityPkg/Tpm2DeviceLibDTpm: Add TPM2 lib supporting SVSM vTPM 2025-03-16 20:21:44 +01:00
SecurityPkg.dec SecurityPkg/Tpm2DeviceLibDTpm: Add TPM2 lib supporting SVSM vTPM 2025-03-16 20:21:44 +01:00
SecurityPkg.dsc SecurityPkg: Add TpmMeasurementLib for SEC phase 2025-03-20 02:37:31 +00:00
SecurityPkg.uni SecurityPkg: SubClassTpm: Updated default value 2023-06-23 16:28:24 +00:00
SecurityPkgExtra.uni SecurityPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:23 -07:00