diff options
| author | Kajal Agarwal <kajal.agarwal@arm.com> | 2026-09-15 17:30:41 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-10-20 19:59:40 +0300 |
| commit | 75b106917296fe7b82d2d14700c90197b905e2a6 (patch) | |
| tree | da1daa8c3018c46e2293b210a014086276a346aa /MdeModulePkg/Library/PiDxeS3BootScriptLib | |
| parent | 4208d71daba23f014b78b73d1b88c53682f6d247 (diff) | |
| download | edk2-75b106917296fe7b82d2d14700c90197b905e2a6.tar.xz | |
ArmPkg/FmpDevicePsaFwuLib: Prevent size underflow
The available request and response payload sizes are calculated by
subtracting the protocol header and fixed data sizes from an unsigned
maximum buffer size. An undersized configured buffer can cause these
calculations to underflow and defeat later bounds checks.
Use a shared switch-case macro to assert at build time that the configured
MM shared buffer can hold the parameter header and each fixed request or
response structure before returning its data size. Reject undersized
buffer configurations at compilation and retain the existing available
payload size calculations.
Set the PcdMmBufferSize package default to 0x10000 in ArmPkg.dec so
builds without a platform override satisfy the library assertions.
Test: AARCH64 DEBUG_GCC library build passes using the DEC default without
a command-line PCD override.
PcdMmBufferSize=1 fails all ten static assertions as expected.
Signed-off-by: Kajal Agarwal <kajal.agarwal@arm.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib')
0 files changed, 0 insertions, 0 deletions
