Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47831 )
Change subject: util/cbfstool: Introduce concept of mmap_window
......................................................................
Patch Set 16:
(2 comments)
Patchset:
PS16:
Kyösti found the error: […]
Sorry about the breakage, Paul. Does this help fix the problem:
```
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 57c9e5117f..3329719a26 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -255,7 +255,8 @@ static int find_mmap_window(enum mmap_addr_type addr_type, unsigned int addr)
else
reg = &mmap_window_table[i].flash_space;
- if (region_offset(reg) <= addr && region_end(reg) >= addr)
+ if (region_offset(reg) <= addr &&
+ ((uint64_t)region_offset(reg) + (uint64_t)region_sz(reg) - 1) >= addr)
return i;
}
```
File util/cbfstool/cbfstool.c:
https://review.coreboot.org/c/coreboot/+/47831/comment/98a8537f_4a7ad09e
PS16, Line 197: >=
static inline size_t region_end(const struct region *r) […]
Yeah, both the points you pointed out are problems and need to be fixed:
* region_end() is non-inclusive
* check doesn't work for 32-bit user space
--
To view, visit
https://review.coreboot.org/c/coreboot/+/47831
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8dd3d1c922cc834c1e67f279ffce8fa438d8209c
Gerrit-Change-Number: 47831
Gerrit-PatchSet: 16
Gerrit-Owner: Furquan Shaikh
furquan@google.com
Gerrit-Reviewer: Duncan Laurie
dlaurie@chromium.org
Gerrit-Reviewer: Furquan Shaikh
furquan@google.com
Gerrit-Reviewer: Srinidhi N Kaushik
srinidhi.n.kaushik@intel.com
Gerrit-Reviewer: Tim Wawrzynczak
twawrzynczak@chromium.org
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Angel Pons
th3fanbus@gmail.com
Gerrit-CC: Arthur Heymans
arthur@aheymans.xyz
Gerrit-CC: Krystian Hebel
krystian.hebel@3mdeb.com
Gerrit-CC: Kyösti Mälkki
kyosti.malkki@gmail.com
Gerrit-CC: Nico Huber
nico.h@gmx.de
Gerrit-CC: Patrick Georgi
pgeorgi@google.com
Gerrit-CC: Paul Menzel
paulepanter@users.sourceforge.net
Gerrit-Comment-Date: Thu, 11 Feb 2021 20:36:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber
nico.h@gmx.de
Comment-In-Reply-To: Paul Menzel
paulepanter@users.sourceforge.net
Comment-In-Reply-To: Kyösti Mälkki
kyosti.malkki@gmail.com
Gerrit-MessageType: comment