Attention is currently required from: Jakub Czapiga, Jérémy Compostella, Nico Huber, Werner Zeh.
Julius Werner has posted comments on this change by Nico Huber. ( https://review.coreboot.org/c/coreboot/+/79946?usp=email )
Change subject: region: Turn region_end() into an inclusive region_last() ......................................................................
Patch Set 8: Code-Review+2
(1 comment)
File src/commonlib/region.c:
https://review.coreboot.org/c/coreboot/+/79946/comment/c671fbb4_083abe57?usp... : PS5, Line 16: if (region_last(c) < region_offset(p))
Looks like this is done. Please re-open if I missed anything.
I think what I meant here was to remove the `region_last(c) < region_offset(c)` check, because your `region_create()` stuff already guarantees that regions can't wrap around. Although on closer inspection, I think that's not quite true yet: `rdev_readat()` still creates a `struct region` by hand and can sometimes be called with untrusted inputs.
Let's merge this for now because that isn't quite related to the point of this patch. But it would be good (if you have time) to also make the code inside `region.c` itself use the `region_create()` APIs where necessary to guarantee that we really won't have any wraparounds, and then you can remove that check in `region_is_subregion()`.