bootm: fix wrong conditions about images overlap
A message that is not in the archive (sent off-list or not yet received): CGME20201021051652epcas1p4cc4c14b796a2ee1233ccfcaeb765a8b6@epcas1p4.samsung.com
PATCH 1/1 bootm: fix wrong conditions about images overlap
It doesn't need to consider start byte address.
If ramdisk size is 0x800000 and start address is 0x2700000, then it's used until 0x02efffff, not 0x02f00000. But it's detected to overlapt RD image, when kernel start address is 0x02f00000.
Because it's doing wrong calculation about rd_len.
This patch fixed wrong calculation address position when check condition.
In addition, it needs to check one more condition about overlapping entire area.
--- common/bootm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
common/bootm.c +5 -3
@@ -256,9 +256,11 @@ int bootm_find_images(int flag, int argc, char *const argv[], ulong start,/* check if ramdisk overlaps OS image */ if (images.rd_start && (((ulong )images.rd_start >= start && - (ulong )images.rd_start <= start + size) || - ((ulong )images.rd_end >= start && - (ulong )images.rd_end <= start + size))) { + (ulong )images.rd_start < start + size) || + ((ulong )images.rd_end > start && + (ulong )images.rd_end <= start + size) || + ((ulong )images.rd_start < start && + (ulong )images.rd_end >= start + size))) {printf ("ERROR: RD image overlaps OS image (OS=0x%lx..0x%lx)\n" , start, start + size);return 1 ;
Signature · 1 line
2.28.0
PATCH 1/1 bootm: fix wrong conditions about images overlap
Quoted 8 lines · Jaehoon Chung
It doesn't need to consider start byte address.
If ramdisk size is0x800000and start address is0x2700000, then it's used until0x02efffff, not0x02f00000. But it's detected to overlapt RD image, when kernel start address is0x02f00000.
Because it's doing wrong calculation aboutrd_len.
This patch fixed wrong calculation address position when check condition.
Quoted 6 lines
In addition, it needs to check one more condition about overlapping entire area.
Fixes commit fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")Signed-off-by Jaehoon Chung <[email protected]>
Applied 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: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201024/cfbca416/attachment.sig>