[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.1 32/32] vnc: fix crash when no console attached
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.1 32/32] vnc: fix crash when no console attached |
Date: |
Mon, 7 Oct 2024 22:16:49 +0300 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Since commit e99441a3793b5 ("ui/curses: Do not use console_select()")
qemu_text_console_put_keysym() no longer checks for NULL console
argument, which leads to a later crash:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x00005555559ee186 in qemu_text_console_handle_keysym (s=0x0, keysym=31) at
../ui/console-vc.c:332
332 } else if (s->echo && (keysym == '\r' || keysym == '\n')) {
(gdb) bt
#0 0x00005555559ee186 in qemu_text_console_handle_keysym (s=0x0, keysym=31)
at ../ui/console-vc.c:332
#1 0x00005555559e18e5 in qemu_text_console_put_keysym (s=<optimized out>,
keysym=<optimized out>) at ../ui/console.c:303
#2 0x00005555559f2e88 in do_key_event (vs=vs@entry=0x5555579045c0,
down=down@entry=1, keycode=keycode@entry=60, sym=sym@entry=65471) at
../ui/vnc.c:2034
#3 0x00005555559f845c in ext_key_event (vs=0x5555579045c0, down=1, sym=65471,
keycode=<optimized out>) at ../ui/vnc.c:2070
#4 protocol_client_msg (vs=0x5555579045c0, data=<optimized out>,
len=<optimized out>) at ../ui/vnc.c:2514
#5 0x00005555559f515c in vnc_client_read (vs=0x5555579045c0) at
../ui/vnc.c:1607
Fixes: e99441a3793b5 ("ui/curses: Do not use console_select()")
Fixes: https://issues.redhat.com/browse/RHEL-50529
Cc: qemu-stable@nongnu.org
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 0e60fc80938d9ce84274a36ddfaaa640bdef2be8)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/ui/vnc.c b/ui/vnc.c
index dae5d51210..5057ec8680 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1935,7 +1935,7 @@ static void do_key_event(VncState *vs, int down, int
keycode, int sym)
}
qkbd_state_key_event(vs->vd->kbd, qcode, down);
- if (!qemu_console_is_graphic(vs->vd->dcl.con)) {
+ if (QEMU_IS_TEXT_CONSOLE(vs->vd->dcl.con)) {
QemuTextConsole *con = QEMU_TEXT_CONSOLE(vs->vd->dcl.con);
bool numlock = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_NUMLOCK);
bool control = qkbd_state_modifier_get(vs->vd->kbd, QKBD_MOD_CTRL);
--
2.39.5
- [Stable-9.1.1 17/32] migration/multifd: Fix rb->receivedmap cleanup race, (continued)
- [Stable-9.1.1 17/32] migration/multifd: Fix rb->receivedmap cleanup race, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 18/32] hw/char/stm32l4x5_usart.c: Enable USART ACK bit response, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 19/32] target/arm: Correct ID_AA64ISAR1_EL1 value for neoverse-v1, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 20/32] target/hppa: Fix random 32-bit linux-user crashes, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 26/32] hw/mips/jazz: fix typo in in-built NIC alias, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 25/32] target/ppc: Fix lxvx/stxvx facility check, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 30/32] hw/sd/sdcard: Fix handling of disabled boot partitions, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 21/32] target/ppc: Fix migration of CPUs with TLB_EMB TLB type, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 23/32] hw/loongarch/virt: Add description for virt machine type, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 22/32] migration/multifd: Fix p->iov leak in multifd-uadk.c, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 32/32] vnc: fix crash when no console attached,
Michael Tokarev <=
- [Stable-9.1.1 31/32] testing: bump mips64el cross to bookworm and fix package list, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 27/32] util/timer: avoid deadlock when shutting down, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 29/32] target/arm: Avoid target_ulong for physical address lookups, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 28/32] block/reqlist: allow adding overlapping requests, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 24/32] tcg: Fix iteration step in 32-bit gvec operation, Michael Tokarev, 2024/10/07