mbox series

[0/4] spl: atf: Fix potential bug on getting FIT data

Message ID 20230916082242.583194-1-massimo.pegorer+oss@gmail.com
Headers show
Series spl: atf: Fix potential bug on getting FIT data | expand

Message

Massimo Pegorer Sept. 16, 2023, 8:22 a.m. UTC
If both fit_image_get_entry() and fit_image_get_load() calls fail,
an uninitialized variable value is passed to TF-A as BL3-2 and/or
BL3-3 entry point in spl_invoke_atf().

In real world of current SPL flow this is not expected to occur
because a fit_image_get_load() failure should break boot during
images loading phase, and thus before entering spl_invoke_atf().

Update improve and fix comments.

A minor rework slightly reduces SPL code size up to 72 bytes.
Note: I am not enough confident about uintptr_t and ulong sizes
matching within all architectures, otherwise straightforward pass
of bl3x_entry reference to fit_image_get_xxx would be fine.

Massimo Pegorer (4):
  spl: atf: Improve comments and code readability
  image: fit: Improve functions description comments
  spl: atf: Fix potential but not occurring bug
  spl: atf: Reduce SPL code size

 boot/image-fit.c     | 12 +++----
 common/spl/spl_atf.c | 75 +++++++++++++++++++-------------------------
 2 files changed, 38 insertions(+), 49 deletions(-)