diff options
author | Zheng Xiang | 2018-06-22 14:28:35 +0200 |
---|---|---|
committer | Peter Maydell | 2018-06-22 14:28:35 +0200 |
commit | 5ff9aaabdc6aec367ba139bf3f2ccacd918a495f (patch) | |
tree | 6d8d38a134f6558b31f3667d0ad0801446e37e01 /target/arm/kvm.c | |
parent | target/arm: Minor cleanup for ARMv6-M 32-bit instructions (diff) | |
download | qemu-5ff9aaabdc6aec367ba139bf3f2ccacd918a495f.tar.gz qemu-5ff9aaabdc6aec367ba139bf3f2ccacd918a495f.tar.xz qemu-5ff9aaabdc6aec367ba139bf3f2ccacd918a495f.zip |
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>
Diffstat (limited to 'target/arm/kvm.c')
-rw-r--r-- | target/arm/kvm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 98f5006323..5bf41e151c 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -256,6 +256,7 @@ static void kvm_arm_machine_init_done(Notifier *notifier, void *data) kvm_arm_set_device_addr(kd); } memory_region_unref(kd->mr); + QSLIST_REMOVE_HEAD(&kvm_devices_head, entries); g_free(kd); } memory_listener_unregister(&devlistener); |