linux-stable/drivers/tty
David Woodhouse 5d93cb1ff6 hvc/xen: fix event channel handling for secondary consoles
commit ef5dd8ec88 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:15:00 +00:00
..
hvc hvc/xen: fix event channel handling for secondary consoles 2023-11-28 17:15:00 +00:00
ipwireless
serdev serdev: Add method to assert break signal over tty UART port 2023-04-23 21:51:25 -07:00
serial tty: serial: meson: fix hard LOCKUP on crtscts mode 2023-11-28 17:15:00 +00:00
vt vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF 2023-05-13 20:01:13 +09:00
Kconfig TIOCSTI: Document CAP_SYS_ADMIN behaviour in Kconfig 2023-08-09 14:12:39 +02:00
Makefile
amiserial.c tty: Convert hw_stopped in tty_struct to bool 2023-03-17 15:01:09 +01:00
ehv_bytechan.c
goldfish.c
mips_ejtag_fdc.c
moxa.c
mxser.c tty: Convert hw_stopped in tty_struct to bool 2023-03-17 15:01:09 +01:00
n_gsm.c tty: n_gsm: fix race condition in status line change on dead connections 2023-11-08 14:09:05 +01:00
n_hdlc.c
n_null.c
n_tty.c tty: fix hang on tty device with no_room set 2023-06-15 12:21:11 +02:00
nozomi.c
pty.c tty: make tty_class a static const structure 2023-04-03 21:43:07 +02:00
rpmsg_tty.c
synclink_gt.c tty: synclink_gt: don't allocate and pass dummy flags 2023-04-20 13:32:53 +02:00
sysrq.c tty/sysrq: replace smp_processor_id() with get_cpu() 2023-11-28 17:15:00 +00:00
tty.h tty_audit: make tty pointers in exposed functions const 2023-06-21 17:57:29 +02:00
tty_audit.c tty_audit: make data of tty_audit_log() const 2023-06-21 17:57:29 +02:00
tty_baudrate.c
tty_buffer.c
tty_io.c TIOCSTI: always enable for CAP_SYS_ADMIN 2023-07-20 19:21:16 +02:00
tty_ioctl.c tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-03-29 10:55:53 +02:00
tty_jobctrl.c tty: tty_jobctrl: fix pid memleak in disassociate_ctty() 2023-11-20 11:57:13 +01:00
tty_ldisc.c tty: tty_ldisc: Remove the ret variable 2023-03-09 17:11:18 +01:00
tty_ldsem.c
tty_mutex.c
tty_port.c
ttynull.c
vcc.c tty: vcc: Add check for kstrdup() in vcc_probe() 2023-11-28 17:14:49 +00:00