diff options
author | Patrick Wildt <patrick@blueri.se> | 2019-04-09 22:58:30 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-04-12 22:00:42 +0200 |
commit | 60fd8844af5c47f606680f287db4585d783c1964 (patch) | |
tree | a2016e0490532e9fce2b9176ff44e60335d4819a /doc | |
parent | bba816569075be9bcede1ef5626336ee5d014de8 (diff) | |
download | u-boot-60fd8844af5c47f606680f287db4585d783c1964.zip u-boot-60fd8844af5c47f606680f287db4585d783c1964.tar.gz u-boot-60fd8844af5c47f606680f287db4585d783c1964.tar.bz2 |
efi: fix memory calculation overflow on 32-bit systems
There are Cubox-i machines out there with nearly 4 GiB of RAM. The
RAM starts at 0x10000000 with a size of 0xf0000000. Thus the end
of RAM is at 0x100000000. This overflows a 32-bit integer, which
should be fine since in the EFI memory code the variables used are
all 64-bit with a fixed size. Unfortunately EFI_PAGE_MASK, which is
used in the EFI memory code to remove the lower bits, is based on
the EFI_PAGE_SIZE macro which, uses 1UL with a shift. This means
the resulting mask is UL, which is only 32-bit on ARMv7. Use ULL to
make sure that even on 32-bit platforms we use a 64-bit long mask.
Without this there will be no memory available in the EFI memory map
and bootefi will fail allocating pages.
Signed-off-by: Patrick Wildt <patrick@blueri.se>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions