Skip to contentSkip to conversation

arm: am33xx: security: Fix size calculation on header

PATCH In review Andrew F. Davis 3 participants 3 messages Jan 9, 2018 – Jan 19, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: am33xx: security: Fix size calculation on header

From: Madan Srinivas <[email protected]>

Fix the size calculation in the verify boot. The header size should be subtracted from the image size, not be assigned to the image size.

Fixes 0830d72bb9f8 ("arm: am33xx: security: adds auth support for encrypted images")
---
 arch/arm/mach-omap2/sec-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/sec-common.c +1 -1
index 2630e7d316..674517e30b 100644
@@ -130,7 +130,7 @@ int secure_boot_verify_image(void **image, size_t *size)
 	*size = sig_addr - cert_addr;	/* Subtract out the signature size */
 	/* Subtract header if present */
 	if (strncmp((char *)sig_addr, "CERT_ISW_", 9) == 0)
-		*size = ((u32 *)*image)[HEADER_SIZE_OFFSET];
+		*size -= ((u32 *)*image)[HEADER_SIZE_OFFSET];
 	cert_size = *size;
 
 	/* Check if image load address is 32-bit aligned */
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/1 arm: am33xx: security: Fix size calculation on header

Quoted 5 lines · Andrew F. Davis

From: Madan Srinivas <[email protected]>

Fix the size calculation in the verify boot. The header size should be subtracted from the image size, not be assigned to the image size.

Thanks and regards,
Lokesh

#2 lore raw
In reply to Andrew F. Davis
Quoted 11 lines · Andrew F. Davis

From: Madan Srinivas <[email protected]>

Fix the size calculation in the verify boot. The header size should be subtracted from the image size, not be assigned to the image size.

Fixes 0830d72bb9f8 ("arm: am33xx: security: adds auth support for encrypted images")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180119/493f03ee/attachment.sig>