coreboot/src/drivers/intel
Nico Huber af0d4bce65 region: Introduce region_create() functions
We introduce two new functions to create region objects. They allow us
to check for integer overflows (region_create_untrusted()) or assert
their absence (region_create()).

This fixes potential overflows in region_overlap() checks in SMI
handlers, where we would wrongfully report MMIO as *not* overlapping
SMRAM.

Also, two cases of strtol() in parse_region() (cbfstool),  where the
results were implicitly converted to `size_t`, are replaced with the
unsigned strtoul().

FIT payload support is left out, as it doesn't use the region API
(only the struct).

Change-Id: I4ae3e6274c981c9ab4fb1263c2a72fa68ef1c32b
Ticket: https://ticket.coreboot.org/issues/522
Found-by: Vadim Zaliva <lord@digamma.ai>
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79905
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-08-11 17:07:32 +00:00
..
dptf tree: Use <stdio.h> for snprintf 2024-05-29 10:33:54 +00:00
fsp1_1 region: Introduce region_create() functions 2024-08-11 17:07:32 +00:00
fsp2_0 region: Introduce region_create() functions 2024-08-11 17:07:32 +00:00
gma tree: Remove unused <string.h> 2024-05-29 10:34:08 +00:00
i210 drivers: Add SPDX license headers to Kconfig files 2024-02-18 01:59:32 +00:00
ish device/pci_ids: Add new Intel PTL device IDs for ISH 2024-07-19 03:54:49 +00:00
mipi_camera tree: Use <stdio.h> for snprintf 2024-05-29 10:33:54 +00:00
pmc_mux tree: Use <stdio.h> for snprintf 2024-05-29 10:33:54 +00:00
ptt drivers: Add SPDX license headers to Kconfig files 2024-02-18 01:59:32 +00:00
soundwire tree: Drop duplicated <device/{path,resource}.h> 2024-04-12 04:24:20 +00:00
usb4/retimer tree: Remove unused <string.h> 2024-05-29 10:34:08 +00:00