]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootm: Fix upper bound of FDT overlap checks
authorPali Rohár <pali@kernel.org>
Sat, 27 Aug 2022 12:48:10 +0000 (14:48 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 31 Aug 2022 16:21:47 +0000 (12:21 -0400)
FTD blob can be put immediately after the OS image.
So use strict inequality for start address check.

Fixes: fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
boot/bootm.c

index 29c067fae7e14b2d8556b6bd14b8ada57fed9215..e3233fdf89d7f757a865ca839c59e785b110e745 100644 (file)
@@ -305,9 +305,9 @@ int bootm_find_images(int flag, int argc, char *const argv[], ulong start,
        /* check if FDT overlaps OS image */
        if (images.ft_addr &&
            (((ulong)images.ft_addr >= start &&
-             (ulong)images.ft_addr <= start + size) ||
+             (ulong)images.ft_addr < start + size) ||
             ((ulong)images.ft_addr + images.ft_len >= start &&
-             (ulong)images.ft_addr + images.ft_len <= start + size))) {
+             (ulong)images.ft_addr + images.ft_len < start + size))) {
                printf("ERROR: FDT image overlaps OS image (OS=0x%lx..0x%lx)\n",
                       start, start + size);
                return 1;