]> git.ipfire.org Git - thirdparty/u-boot.git/commit
efi_loader: Fix memory corruption on 32bit systems
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 26 Jul 2023 06:54:52 +0000 (09:54 +0300)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 3 Aug 2023 07:21:02 +0000 (09:21 +0200)
commit829445382c196301309b7f12630c1e04a4986eba
tree86bbb11531e14a22229c2e135460f685a0f4b2f8
parentef279f81ae813c9d0128490877227b75d1fd61a5
efi_loader: Fix memory corruption on 32bit systems

It's pretty unlikely that anyone is going to be using EFI authentication
on a 32bit system.  However, if you did, the efi_prepare_aligned_image()
function would write 8 bytes of data to the &efi_size variable and it
can only hold 4 bytes so that corrupts memory.

Fixes: 163a0d7e2cbd ("efi_loader: add PE/COFF image measurement")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_image_loader.c