[PATCH] arm: imx: fix signature_block_hdr struct fields order

Viguera, Javier Javier.Viguera at digi.com
Thu Apr 4 13:58:31 CEST 2024


Hi Fabio,

First, sorry for the delay. I was out of the office (Easter).

-----Original Message-----
From: Fabio Estevam <festevam at gmail.com> 
Could you elaborate more about this and share more details?
Have you seen a run-time error or did you catch it by code inspection?

The struct has the fields in the wrong order according to other documentation from NXP (see for example the AN13994 - Encrypted Boot on AHAB-enabled devices).

In the current upstream u-boot code there is NO runtime error, as those fields are not being used. Only ' get_container_size`on  `arch/arm/mach-imx/image-container.c`  defines a variable of that type. But then it only uses the "length_lsb" and "length_msb" fiels, which are at the beginning of the struct and thus in the correct position.

On the other hand, we were hit by this problem in some bootloader encryption related code we do in our (as of Digi) BSP. We get the blob offset from the signature block header to read the data encryption key blob and due to the wrong order this patch fixes, we were getting a wrong position of the DEK blob.

Hope this clears it up a bit.

--
Javier Viguera
Software Engineer at Digi International.





More information about the U-Boot mailing list