Fix integer overflows in BL1 FWU code
Sandrine Bailleux authored
Before adding a base address and a size to compute the end
address of an image to copy or authenticate, check this
won't result in an integer overflow. If it does then consider
the input arguments are invalid.

As a result, bl1_plat_mem_check() can now safely assume the
end address (computed as the sum of the base address and size
of the memory region) doesn't overflow, as the validation is
done upfront in bl1_fwu_image_copy/auth(). A debug assertion
has been added nonetheless in the ARM implementation in order
to help catching such problems, should bl1_plat_mem_check()
be called in a different context in the future.

Fixes TFV-1: Malformed Firmware Update SMC can result in copy
of unexpectedly large data into secure memory

Change-Id: I8b8f8dd4c8777705722c7bd0e8b57addcba07e25
Signed-off-by: default avatarSandrine Bailleux <sandrine.bailleux@arm.com>
Signed-off-by: default avatarDan Handley <dan.handley@arm.com>
949a52d2
Name Last commit Last update
bl1 Fix integer overflows in BL1 FWU code
bl2 Define and use no_ret macro where no return is expected
bl2u Define and use no_ret macro where no return is expected
bl31 Define and use no_ret macro where no return is expected
bl32 Merge pull request #775 from soby-mathew/sm/AArch32_stack_align
common Export is_mem_free() function
docs Merge pull request #785 from dp-arm/dp/nvcounter
drivers tbbr: Fix updating of Non-Trusted NV counter
fdts Fix incorrect copyright notices
include Export is_mem_free() function
lib Merge pull request #779 from dp-arm/dp/rtinstr-cache
make_helpers Fix incorrect copyright notices
plat Fix integer overflows in BL1 FWU code
services Check Trusty is present during the SPD's initialization
tools fiptool: Provide malloc/strdup wrappers to simplify error checking
.checkpatch.conf Mandate 'Signed-off-by' line in commit messages
.gitignore .gitignore: ignore editor backup files
Makefile Enable TRUSTED_BOARD_BOOT support for LOAD_IMAGE_V2=1
acknowledgements.md Add Xilinx to acknowledgements file
contributing.md Drop requirement for CLA in contribution.md
dco.txt Drop requirement for CLA in contribution.md
license.md Update year in copyright text to 2014
readme.md readme.md: Add tested Linaro release information for FVPs