From 28dc906f6107ce8510a1ba07894ac966bad9b27d Mon Sep 17 00:00:00 2001 From: Ji Luo Date: Thu, 24 Aug 2023 16:17:09 +0800 Subject: MA-21597 check spl fit pointer before parsing it the spl fit pointer could be set as NULL in HAB verify failed case, return error in such case. Change-Id: Idb44a19ca89f2a6065ea423782441e57109d6e3a Signed-off-by: Ji Luo Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Backport from NXP downstream [6cb283bb4e19da6667abaedd83efc23a15fdc48d] Signed-off-by: Max Krummenacher --- common/spl/spl_fit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 9d5a6dccec..1ab201b2f2 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -736,6 +736,9 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, return 0; ctx.fit = spl_load_simple_fit_fix_load(ctx.fit); + if (ctx.fit == NULL) { + return -1; + } ret = spl_simple_fit_parse(&ctx); if (ret < 0) -- cgit v1.2.3