On 9/11/26 13:14, Cédric Le Goater wrote:
When the host kernel fails to assign a BAR (broken BIOS "Above 4G
Decoding" or ReBAR configuration), the VFIO kernel interface reports
a zero size. In that case, vfio_region_setup() skips allocating
region->mem, leaving it NULL.
Then, vfio_bar_quirk_setup() calls the BAR quirk probes and passes
a NULL region->mem pointer to memory_region_add_subregion_overlap(),
causing a segfault in memory_region_update_container_subregions().
Skip quirk setup in vfio_realize() for zero size regions.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2732
Signed-off-by: Cédric Le Goater <[email protected]>
---
hw/vfio/pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>