From: Andrew F. Davis <afd@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: mach-keystone: Modify secure image size before copy
Date: Thu, 29 Jun 2017 08:38:25 -0500 [thread overview]
Message-ID: <20170629133825.25844-1-afd@ti.com> (raw)
The size of the secure image does not include the size of the
header, subtract this out before we move the image or we grab
extra data after the image.
Signed-off-by: Andrew F. Davis <afd@ti.com>
---
arch/arm/mach-keystone/mon.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-keystone/mon.c b/arch/arm/mach-keystone/mon.c
index 81009848d0..ebfb483a1b 100644
--- a/arch/arm/mach-keystone/mon.c
+++ b/arch/arm/mach-keystone/mon.c
@@ -114,12 +114,12 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
}
/*
- * Overwrite the image headers after authentication
- * and decryption. Update size to reflect removal
- * of header.
- */
- memcpy(image, image + KS2_HS_SEC_HEADER_LEN, *p_size);
+ * Overwrite the image headers after authentication
+ * and decryption. Update size to reflect removal
+ * of header.
+ */
*p_size -= KS2_HS_SEC_HEADER_LEN;
+ memcpy(image, image + KS2_HS_SEC_HEADER_LEN, *p_size);
/*
* Output notification of successful authentication to re-assure the
--
2.13.0
next reply other threads:[~2017-06-29 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 13:38 Andrew F. Davis [this message]
2017-06-30 1:59 ` [U-Boot] [PATCH] arm: mach-keystone: Modify secure image size before copy Lokesh Vutla
2017-07-11 12:41 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170629133825.25844-1-afd@ti.com \
--to=afd@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox