summaryrefslogtreecommitdiff
path: root/Silicon/Socionext/SynQuacer/Library
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2018-03-16 15:00:38 +0000
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2018-06-01 11:57:27 +0200
commit913fdda9f4b941916d73700848aefa0f4c722a02 (patch)
tree6b98f2014e0c6b04a78a72d72de6114f1385b5f8 /Silicon/Socionext/SynQuacer/Library
parente3dc34956a641d3d6c2d32348ca53899eda4325e (diff)
Silicon/SynQuacerPlatformFlashAccessLib: don't dereference FVB header fields
When we updated the capsule definition to cover the ARM Trusted Firmware binary image as well as the firmware volume containing the EDK2 code, we failed to recognize that the start of the image no longer constitutes a Firmware Volume header, and so we should not interpret the data as such. Note that this makes the FVB protocol slighty less appropriate as the abstraction to use to write this data, but given that there does not appear to be a better match (disk I/O, block I/O), let's stick with it for now, but require the base address to match the capsule's target address exactly rather than reading the size of the FV from the header. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Silicon/Socionext/SynQuacer/Library')
-rw-r--r--Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
index 1af4abc1..82fe3f74 100644
--- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
+++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c
@@ -53,7 +53,6 @@ GetFvbByAddress (
UINTN HandleCount;
UINTN Index;
EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
- EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader;
EFI_FVB_ATTRIBUTES_2 Attributes;
//
@@ -103,8 +102,7 @@ GetFvbByAddress (
continue;
}
- FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) *FvbBaseAddress);
- if ((Address >= *FvbBaseAddress) && (Address <= (*FvbBaseAddress + FwVolHeader->FvLength))) {
+ if (Address == *FvbBaseAddress) {
*OutFvb = Fvb;
Status = EFI_SUCCESS;
break;