u-boot/lib/efi_loader
Stefan Brüns bdf5c1b360 efi_loader: Fix memory map size check to avoid out-of-bounds access
The current efi_get_memory_map() function overwrites the map_size
property before reading its value. That way the sanity check whether our
memory map fits into the given array always succeeds, potentially
overwriting arbitrary payload memory.

This patch moves the property update write after its sanity check, so
that the check actually verifies the correct value.

So far this has not triggered any known bugs, but we're better off safe
than sorry.

If the buffer is to small, the returned memory_map_size indicates the
required size to the caller.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2016-10-18 09:08:07 +02:00
..
efi_boottime.c arm: Add return value argument to longjmp 2016-10-08 09:33:34 -04:00
efi_console.c efi_loader: Add console interface 2016-03-15 18:03:09 -04:00
efi_disk.c efi_loader: disk: Sanitize exposed devices 2016-08-08 13:33:00 -04:00
efi_gop.c efi_loader: Add DM_VIDEO support 2016-06-06 13:39:17 -04:00
efi_image_loader.c efi_loader: Fix relocations above 64kb image size 2016-08-20 14:03:27 -04:00
efi_memory.c efi_loader: Fix memory map size check to avoid out-of-bounds access 2016-10-18 09:08:07 +02:00
efi_net.c efi_loader: Add network access support 2016-05-27 10:01:10 -04:00
efi_runtime.c efi_loader: Move to normal debug infrastructure 2016-06-06 13:39:16 -04:00
Kconfig efi_loader: Add bounce buffer support 2016-05-27 15:39:48 -04:00
Makefile efi_loader: Add network access support 2016-05-27 10:01:10 -04:00