qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

target-arm: fix a segmentation fault due to illegal memory access

The elements of kvm_devices_head list are freed in kvm_arm_machine_init_done(),
but we still access these illegal memory in kvm_arm_devlistener_del().

This will cause segment fault when booting guest with MALLOC_PERTURB_=1.

Signed-off-by: Zheng Xiang <xiang.zheng@linaro.org>
Message-id: 20180619075821.9884-1-zhengxiang9@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Zheng Xiang and committed by
Peter Maydell
5ff9aaab 8297cb13

+1
+1
target/arm/kvm.c
··· 256 256 kvm_arm_set_device_addr(kd); 257 257 } 258 258 memory_region_unref(kd->mr); 259 + QSLIST_REMOVE_HEAD(&kvm_devices_head, entries); 259 260 g_free(kd); 260 261 } 261 262 memory_listener_unregister(&devlistener);