u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] bootm: Fix upper bound of FDT overlap checks
@ 2022-08-27 12:48 Pali Rohár
  2022-08-30  2:30 ` Simon Glass
  2022-08-31 23:34 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2022-08-27 12:48 UTC (permalink / raw)
  To: Simon Glass, Tero Kristo; +Cc: u-boot

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>
---
 boot/bootm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/boot/bootm.c b/boot/bootm.c
index 86dbfbcfed5b..e4493f3ed5f1 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -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;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bootm: Fix upper bound of FDT overlap checks
  2022-08-27 12:48 [PATCH] bootm: Fix upper bound of FDT overlap checks Pali Rohár
@ 2022-08-30  2:30 ` Simon Glass
  2022-08-31 23:34 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-08-30  2:30 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Tero Kristo, U-Boot Mailing List

On Sat, 27 Aug 2022 at 06:48, Pali Rohár <pali@kernel.org> wrote:
>
> 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>
> ---
>  boot/bootm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bootm: Fix upper bound of FDT overlap checks
  2022-08-27 12:48 [PATCH] bootm: Fix upper bound of FDT overlap checks Pali Rohár
  2022-08-30  2:30 ` Simon Glass
@ 2022-08-31 23:34 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-08-31 23:34 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Simon Glass, Tero Kristo, u-boot

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

On Sat, Aug 27, 2022 at 02:48:10PM +0200, Pali Rohár wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-31 23:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27 12:48 [PATCH] bootm: Fix upper bound of FDT overlap checks Pali Rohár
2022-08-30  2:30 ` Simon Glass
2022-08-31 23:34 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).