On Sat, 07 Feb 2026 16:33:30 +0100, Ronald Wahl wrote:

> Currently when CONFIG_SPL_STACK_R and CONFIG_SPL_SYS_MALLOC_SIMPLE is
> enabled then spl_relocate_stack_gd() will setup a layout where the stack
> lays inside the heap and grows down to heap start. Also the global data
> is part of the heap. This can lead to corruption of stack and global
> data. The current layout is:
> 
>                     0x0 +-------------+
>                         .             .
>                         .             .
>         gd->malloc_base +- - - - - - -+
>                         |             |\
>                         | HEAP/STACK  | \
>                         |             |  } SPL_STACK_R_MALLOC_SIMPLE_LEN
>       gd->start_addr_sp +- - - - - - -+ /  (gd->malloc_limit)
>                         | GLOBAL DATA |/
> CONFIG_SPL_STACK_R_ADDR +-------------+
> 
> [...]

Applied to u-boot/next, thanks!

[1/1] spl: fix stack placement in spl_relocate_stack_gd()
      commit: ef65b15383c99f4562539a635fe166fb4d75c0e3
-- 
Tom


Reply via email to