]> git.dujemihanovic.xyz Git - u-boot.git/commit
efi_loader: don't load beyond VirtualSize
authorAsherah Connor <ashe@kivikakk.ee>
Tue, 9 Feb 2021 06:19:48 +0000 (06:19 +0000)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 14 Feb 2021 09:34:15 +0000 (10:34 +0100)
commit9d30a941cce5ed055da18398f4deba18830d00d6
tree0300604aeca5a4aaf85034fc5f792a32ede1b511
parent7c82e12cc4e9e25d7c89fe15bfeec4e9b0bb2b4d
efi_loader: don't load beyond VirtualSize

PE section table entries' SizeOfRawData must be a multiple of
FileAlignment, and thus may be rounded up and larger than their
VirtualSize.

We should not load beyond the VirtualSize, which is "the total size of
the section when loaded into memory" -- we may clobber real data at the
target in some other section, since we load sections in reverse order
and sections are usually laid out sequentially.

Signed-off-by: Asherah Connor <ashe@kivikakk.ee>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_image_loader.c