[PATCH 0/2] lmb: consider EFI memory map

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Wed Jan 4 05:26:04 CET 2023


As reported in Debian bug #1027176 relocation of the initrd may lead to
overwriting memory used by the EFI sub-system.

Currently the available memory for images is determined via the lmb
library functions. The lmb library has several shortcomings:

* It does not protect against overwriting one image with another.
* The same routines to find reserved memory are called again and
  again.

In the long run we should move to allocating memory for images.

As an intermediate solutions let's add lmb-reservations for all EFI memory
areas that are not EFI_CONVENTIONAL_MEMORY.

The variable $loadaddr of at least the vexpress_ca9x4 board collids with
memory used by the EFI sub-system. Adjust $loadaddr for the vexpress
boards to a sane value.

Heinrich Schuchardt (2):
  vexpress: adjust loadaddr
  lmb: consider EFI memory map

 include/configs/vexpress_common.h |  1 +
 lib/lmb.c                         | 45 +++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

-- 
2.37.2



More information about the U-Boot mailing list