On 1/28/19 9:42 AM, Peter Maydell wrote: > The tcg_register_iommu_notifier() code has a GArray of > TCGIOMMUNotifier structs which it has registered by passing > memory_region_register_iommu_notifier() a pointer to the embedded > IOMMUNotifier field. Unfortunately, if we need to enlarge the > array via g_array_set_size() this can cause a realloc(), which > invalidates the pointer that memory_region_register_iommu_notifier() > put into the MemoryRegion's iommu_notify list. This can result > in segfaults. > > Switch the GArray to holding pointers to the TCGIOMMUNotifier > structs, so that we can individually allocate and free them. > > Cc: qemu-sta...@nongnu.org > Fixes: 1f871c5e6b0f30644a60a ("exec.c: Handle IOMMUs in > address_space_translate_for_iotlb()") > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > --- > I don't know why I've suddenly started running into this; possibly > it's because of a recent Ubuntu upgrade and so a newer glibc. > --- > exec.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-)
Reviewed-by: Richard Henderson <richard.hender...@linaro.org> It is odd that we have not seen this before... r~