[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/6] msmouse: Fix segfault caused by free the chr bef
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 4/6] msmouse: Fix segfault caused by free the chr before chardev cleanup. |
Date: |
Thu, 22 Sep 2016 18:52:16 +0200 |
From: Lin Ma <address@hidden>
Segfault happens when leaving qemu with msmouse backend:
#0 0x00007fa8526ac975 in raise () at /lib64/libc.so.6
#1 0x00007fa8526add8a in abort () at /lib64/libc.so.6
#2 0x0000558be78846ab in error_exit (err=16, msg=0x558be799da10 ...
#3 0x0000558be7884717 in qemu_mutex_destroy (mutex=0x558be93be750) at ...
#4 0x0000558be7549951 in qemu_chr_free_common (chr=0x558be93be750) at ...
#5 0x0000558be754999c in qemu_chr_free (chr=0x558be93be750) at ...
#6 0x0000558be7549a20 in qemu_chr_delete (chr=0x558be93be750) at ...
#7 0x0000558be754a8ef in qemu_chr_cleanup () at qemu-char.c:4643
#8 0x0000558be755843e in main (argc=5, argv=0x7ffe925d7118, ...
The chr was freed by msmouse close callback before chardev cleanup,
Then qemu_mutex_destroy triggered raise().
Because freeing chr is handled by qemu_chr_free_common, Remove the free from
msmouse_chr_close to avoid double free.
Fixes: c1111a24a3358ecd2f17be7c8b117cfe8bc5e5f8
Cc: address@hidden
Signed-off-by: Lin Ma <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
backends/msmouse.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/backends/msmouse.c b/backends/msmouse.c
index aceb6dc..85d08f7 100644
--- a/backends/msmouse.c
+++ b/backends/msmouse.c
@@ -139,7 +139,6 @@ static void msmouse_chr_close (struct CharDriverState *chr)
qemu_input_handler_unregister(mouse->hs);
g_free(mouse);
- g_free(chr);
}
static QemuInputHandler msmouse_handler = {
--
2.7.4
- [Qemu-devel] [PULL 0/6] Misc patches for 2016-09-22, Paolo Bonzini, 2016/09/22
- [Qemu-devel] [PULL 1/6] target-i386: introduce kvm_put_one_msr, Paolo Bonzini, 2016/09/22
- [Qemu-devel] [PULL 2/6] kvm: apic: set APIC base as part of kvm_apic_put, Paolo Bonzini, 2016/09/22
- [Qemu-devel] [PULL 3/6] iscsi: Fix divide-by-zero regression on raw SG devices, Paolo Bonzini, 2016/09/22
- [Qemu-devel] [PULL 4/6] msmouse: Fix segfault caused by free the chr before chardev cleanup.,
Paolo Bonzini <=
- [Qemu-devel] [PULL 5/6] scripts: Add a script to check for bug URLs in the git log, Paolo Bonzini, 2016/09/22
- [Qemu-devel] [PULL 6/6] kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0, Paolo Bonzini, 2016/09/22
- Re: [Qemu-devel] [PULL 0/6] Misc patches for 2016-09-22, Eric Blake, 2016/09/22