From 7a80de464167ec45fdb70f63d83d07f7c2c57b82 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 24 Feb 2016 09:14:42 -0700 Subject: image: Correct the OS location code to work on sandbox A recent change broke the 'bootm' command on sandbox. The root cause is using a pointer as an address. Conversion from pointer to address needs to use map_to_sysmem() so that sandbox can do the right thing. The problem was pre-existing but uncovered by a recent commit. Fix this. Also move fit_get_end() to the C file to avoid needing to include mapmem.h (and thus asm/io.h) everywhere. Fixes: 1fec3c5d (common/image.c: Make boot_get_ramdisk() perform a check for Android images) Signed-off-by: Simon Glass --- common/image-fit.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common/image-fit.c') diff --git a/common/image-fit.c b/common/image-fit.c index c531ee74d7..d3fad30c34 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -851,6 +851,11 @@ static int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore) return 0; } +ulong fit_get_end(const void *fit) +{ + return map_to_sysmem((void *)(fit + fdt_totalsize(fit))); +} + /** * fit_set_timestamp - set node timestamp property * @fit: pointer to the FIT format image header -- cgit From 2e33e761656f30651ed9ae16ecdbd5117d51d7d2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 24 Feb 2016 09:14:43 -0700 Subject: Revert "image-fit: Fix signature checking" This reverts commit 84ca65aa4bd0d03867e9e49805201d0564d3ffb0. On signature verification failures fit_image_verify() should NOT exit with error. Only keys marked 'required' can cause image verification failure. This logic is already there and works correctly. Add a comment to make this clear. Fixes: 84ca65aa (image-fit: Fix signature checking) Signed-off-by: Simon Glass --- common/image-fit.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'common/image-fit.c') diff --git a/common/image-fit.c b/common/image-fit.c index d3fad30c34..fbd9e0d770 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -1035,10 +1035,15 @@ int fit_image_verify(const void *fit, int image_noffset) strlen(FIT_SIG_NODENAME))) { ret = fit_image_check_sig(fit, noffset, data, size, -1, &err_msg); - if (ret) { + + /* + * Show an indication on failure, but do not return + * an error. Only keys marked 'required' can cause + * an image validation failure. See the call to + * fit_image_verify_required_sigs() above. + */ + if (ret) puts("- "); - goto error; - } else puts("+ "); } -- cgit