Skip to contentSkip to conversation

arm: mach-omap2: Flush cache after FIT post-processing image

PATCH In review Andrew F. Davis 2 participants 3 messages Feb 22, 2017 – Mar 1, 2017

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

PATCH 1/1 arm: mach-omap2: Flush cache after FIT post-processing image

After we authenticate/decrypt an image we need to flush the caches as they may still contain bits of the encrypted image. This will cause failures if we attempt to jump to this image.

---
 arch/arm/mach-omap2/sec-common.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-omap2/sec-common.c +6 -0
index c5a000ac3a..0fa8db05fe 100644
@@ -120,6 +120,12 @@ int secure_boot_verify_image(void **image, size_t *size)
 	result = secure_rom_call(
 		API_HAL_KM_VERIFYCERTIFICATESIGNATURE_INDEX, 0, 0,
 		4, cert_addr, cert_size, sig_addr, 0xFFFFFFFF);
+
+	/* Perform cache writeback on output buffer */
+	flush_dcache_range(
+		(u32)*image,
+		(u32)*image + roundup(*size, ARCH_DMA_MINALIGN));
+
 auth_exit:
 	if (result != 0) {
 		printf("Authentication failed!\n");
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 arm: mach-omap2: Flush cache after FIT post-processing image

Quoted 6 lines · Andrew F. Davis

After we authenticate/decrypt an image we need to flush the caches as they may still contain bits of the encrypted image. This will cause failures if we attempt to jump to this image.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170227/7e3fbeb8/attachment.sig>
#2 lore raw
In reply to Andrew F. Davis
Quoted 7 lines · Andrew F. Davis

After we authenticate/decrypt an image we need to flush the caches as they may still contain bits of the encrypted image. This will cause failures if we attempt to jump to this image.

Applied prior to v2017.03-rc3 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: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170301/0f1f00af/attachment.sig>