diff options
author | Ye Li <ye.li@nxp.com> | 2017-11-21 20:37:21 -0600 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-11-21 20:53:33 -0600 |
commit | 8d628654111705c5cbba4eba2ddc72673c98c8be (patch) | |
tree | 7e26eda4a1b9cfad8efdc29793e0a2c612ec18ab | |
parent | 1d42ecc53dc05735c8ef134221c4d532c32c62b9 (diff) |
MLK-16931 imx8m: hab: Fix secure boot build warning
Found HAB build warnings on mScale, those relate to ARM 64 bits conversion.
arch/arm/imx-common/hab.c: In function ‘csf_is_valid’:
arch/arm/imx-common/hab.c:556:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
!chk_bounds((const uint8_t *)ivt_initial->csf,
^
In file included from arch/arm/imx-common/hab.c:14:0:
arch/arm/imx-common/hab.c:557:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
HAB_HDR_LEN(*(const struct hab_hdr *)ivt_initial->csf),
^
./arch/arm/include/asm/imx-common/hab.h:177:40: note: in definition of macro ‘HAB_HDR_LEN’
((size_t)(((const struct hab_hdr *)&(hdr))->len[0] << 8) \
^~~
arch/arm/imx-common/hab.c:557:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
HAB_HDR_LEN(*(const struct hab_hdr *)ivt_initial->csf),
^
./arch/arm/include/asm/imx-common/hab.h:178:41: note: in definition of macro ‘HAB_HDR_LEN’
+ (size_t)((const struct hab_hdr *)&(hdr))->len[1])
^~~
arch/arm/imx-common/hab.c:563:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
csf_hdr = (const uint8_t *)ivt_initial->csf;
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r-- | arch/arm/imx-common/hab.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/imx-common/hab.c b/arch/arm/imx-common/hab.c index dfda5ee771..c4680f189b 100644 --- a/arch/arm/imx-common/hab.c +++ b/arch/arm/imx-common/hab.c @@ -554,14 +554,14 @@ static int csf_is_valid(int ivt_offset, ulong start_addr, size_t bytes) /* Check that the CSF lies within the image bounds */ if ((start == 0) || (ivt_initial == NULL) || (ivt_initial->csf == 0) || - !chk_bounds((const uint8_t *)ivt_initial->csf, - HAB_HDR_LEN(*(const struct hab_hdr *)ivt_initial->csf), + !chk_bounds((const uint8_t *)(ulong)ivt_initial->csf, + HAB_HDR_LEN(*(const struct hab_hdr *)(ulong)ivt_initial->csf), start, end)) { puts("Error - CSF lies outside the image bounds\n"); return 0; } - csf_hdr = (const uint8_t *)ivt_initial->csf; + csf_hdr = (const uint8_t *)(ulong)ivt_initial->csf; if (*csf_hdr == HAB_CMD_HDR) { csf_hdr_len = HAB_HDR_LEN(*(const struct hab_hdr *)csf_hdr); |