On 2026-07-30T13:24:10, Alexey Charkov <[email protected]> wrote: > spl: fit: Fill in the image descriptor when skipping a zero-size image > > load_simple_fit() is expected to fill in the image_info structure it > receives upon successful return, but the path which skips a zero-sized > image returns success without touching it. The result is that > spl_fit_record_loadable() then publishes whatever else the descriptor > happened to hold in /fit-images under the skipped image's name: the size > and entry point of the previous loadable, or - for the first one, since > image_info is declared without an initialiser - uninitialised stack. > > This is reachable whenever a FIT carries an image node with no content, > which binman produces for an optional blob that was not supplied, such as > an OP-TEE which the build did not provide. > > Ensure that the image_info structure is filled in with a size and entry > point before returning, same way as other successful paths do (but > skipping the actual load). > > Fixes: 6d99f866952b ("spl: fit: Skip attempting to load 0 length image") > Signed-off-by: Alexey Charkov <[email protected]> > > common/spl/spl_fit.c | 40 +++++++++++++++++++++++++++++----------- > 1 file changed, 29 insertions(+), 11 deletions(-)
Reviewed-by: Simon Glass <[email protected]>
