Commit d1515ca9cd5dc982743ab2a8822a3c834fb2eeb6
Committed by
Ye Li
1 parent
822252fdc1
Exists in
smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga
and in
4 other branches
MLK-21389 imx: hab: Check if IVT header is HABv4
The HABv4 implementation in ROM checks if HAB major version in IVT header is 4.x. The current implementation in hab.c code is only validating HAB v4.0 and HAB v4.1 and may be incompatible with newer HABv4 versions. Modify verify_ivt_header() function to align with HABv4 implementation in ROM code. Signed-off-by: Breno Lima <breno.lima@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 33f51b401dffa393274a28f9d49a87af3eb02fe0)
Showing 2 changed files with 1 additions and 4 deletions Side-by-side Diff
arch/arm/include/asm/mach-imx/hab.h
arch/arm/mach-imx/hab.c
... | ... | @@ -47,8 +47,7 @@ |
47 | 47 | if (be16_to_cpu(ivt_hdr->length) != IVT_TOTAL_LENGTH) |
48 | 48 | result = ivt_header_error("bad length", ivt_hdr); |
49 | 49 | |
50 | - if (ivt_hdr->version != IVT_HEADER_V1 && | |
51 | - ivt_hdr->version != IVT_HEADER_V2) | |
50 | + if ((ivt_hdr->version & HAB_MAJ_MASK) != HAB_MAJ_VER) | |
52 | 51 | result = ivt_header_error("bad version", ivt_hdr); |
53 | 52 | |
54 | 53 | return result; |