1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00
Files
u-boot-megous/common
Richard Weinberger b177d61708 bootstage: Fix out-of-bounds read in reloc_bootstage()
bootstage_get_size() returns the total size of the data structure
including associated records.
When copying from gd->bootstage, only the allocation size of gd->bootstage
must be used. Otherwise too much memory is copied.

This bug caused no harm so far because gd->new_bootstage is always
large enough and reading beyond the allocation length of gd->bootstage
caused no problem due to the U-Boot memory layout.

Fix by using the correct size and perform the initial copy directly
in bootstage_relocate() to have the whole relocation process in the
same function.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Simon Glass <sjg@chromium.org>
(cherry picked from commit 1779a58c66)
2024-10-08 15:41:08 +02:00
..
2024-05-22 08:55:29 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-31 16:51:54 +02:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00
2024-07-15 12:12:17 -06:00