android_kernel_samsung_sm8650/drivers/tty
David Woodhouse 1a2c7a2f35 hvc/xen: fix event channel handling for secondary consoles
commit ef5dd8ec88ac11e8e353164407d55b73c988b369 upstream.

The xencons_connect_backend() function allocates a local interdomain
event channel with xenbus_alloc_evtchn(), then calls
bind_interdomain_evtchn_to_irq_lateeoi() to bind to that port# on the
*remote* domain.

That doesn't work very well:

(qemu) device_add xen-console,id=con1,chardev=pty0
[   44.323872] xenconsole console-1: 2 xenbus_dev_probe on device/console/1
[   44.323995] xenconsole: probe of console-1 failed with error -2

Fix it to use bind_evtchn_to_irq_lateeoi(), which does the right thing
by just binding that *local* event channel to an irq. The backend will
do the interdomain binding.

This didn't affect the primary console because the setup for that is
special — the toolstack allocates the guest event channel and the guest
discovers it with HVMOP_get_param.

Fixes: fe415186b4 ("xen/console: harden hvc_xen against event channel storms")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20231020161529.355083-2-dwmw2@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:07:08 +00:00
..
hvc hvc/xen: fix event channel handling for secondary consoles 2023-11-28 17:07:08 +00:00
ipwireless
serdev
serial tty: serial: meson: fix hard LOCKUP on crtscts mode 2023-11-28 17:07:08 +00:00
vt vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF 2023-05-24 17:32:51 +01:00
amiserial.c tty: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
ehv_bytechan.c
goldfish.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c tty: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
mxser.c tty: mxser: remove redundant assignment to hwid 2022-09-01 17:59:36 +02:00
n_gsm.c tty: n_gsm: fix race condition in status line change on dead connections 2023-11-08 14:11:03 +01:00
n_hdlc.c tty: n_hdlc: remove HDLC_MAGIC 2022-09-22 16:12:34 +02:00
n_null.c
n_tty.c tty: fix hang on tty device with no_room set 2023-08-03 10:23:53 +02:00
nozomi.c
pty.c tty: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
rpmsg_tty.c
synclink_gt.c tty: synclink_gt: remove MGSL_MAGIC 2022-09-22 16:12:34 +02:00
sysrq.c tty/sysrq: replace smp_processor_id() with get_cpu() 2023-11-28 17:07:08 +00:00
tty_audit.c
tty_baudrate.c tty: Fix comment style in tty_termios_input_baud_rate() 2022-08-30 14:22:34 +02:00
tty_buffer.c tty: Fix lookahead_buf crash with serdev 2022-08-30 14:31:53 +02:00
tty_io.c tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-05-11 23:03:01 +09:00
tty_ioctl.c tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-05-11 23:03:01 +09:00
tty_jobctrl.c tty: tty_jobctrl: fix pid memleak in disassociate_ctty() 2023-11-20 11:52:09 +01:00
tty_ldisc.c
tty_ldsem.c
tty_mutex.c tty: remove TTY_MAGIC 2022-09-22 16:12:34 +02:00
tty_port.c
tty.h tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-05-11 23:03:01 +09:00
ttynull.c
vcc.c tty: vcc: Add check for kstrdup() in vcc_probe() 2023-11-28 17:07:01 +00:00