Skip to contentSkip to conversation

spl: atf: Fix potential bug on getting FIT data

PATCH In review Massimo Pegorer 1 participant 1 message Sep 16, 2023

lore
Share & tools
lore
#0 lore raw

cover spl: atf: Fix potential bug on getting FIT data

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(-)
Signature · 1 line
2.34.1