Attention is currently required from: Jakub Czapiga, Jérémy Compostella, Werner Zeh.
Hello Jakub Czapiga, Jérémy Compostella, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/79977?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed: Verified-1 by build bot (Jenkins)
Change subject: tree: Refactor region_end() to return last used address of a region ......................................................................
tree: Refactor region_end() to return last used address of a region
Currently, function region_end() does return the next address after the end of a given region. This is not only confusing (as the next address after a region is not part of this region anymore) but can lead to integer overflow if the region's end reaches SIZE_MAX. This possible overflow can then lead to not catching a region overlap as reported in a bug in [1].
This patch changes now the behavior of region_end() and makes it return the last valid address of a region. In addition, the integer overflow is checked and if it would happen, SIZE_MAX is returned (which truncates the region's end to SIZE_MAX for this corner case).
And since region_end() now returns a different address, some unit-tests need adjustments.
[1]: https://ticket.coreboot.org/issues/522
Change-Id: Ide7a39af1609fed63d08832a6dcc4679a85c5027 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/commonlib/include/commonlib/region.h M src/commonlib/region.c M src/cpu/x86/smm/smm_module_loader.c M src/drivers/spi/winbond.c M src/include/cpu/x86/smm.h M tests/commonlib/region-test.c M util/cbfstool/cse_serger.c 7 files changed, 33 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/77/79977/2