linux-stable/drivers/tty/vt
Jiri Slaby 687bff0cd0 vt: selection, handle pending signals in paste_selection
When pasting a selection to a vt, the task is set as INTERRUPTIBLE while
waiting for a tty to unthrottle. But signals are not handled at all.
Normally, this is not a problem as tty_ldisc_receive_buf receives all
the goods and a user has no reason to interrupt the task.

There are two scenarios where this matters:
1) when the tty is throttled and a signal is sent to the process, it
   spins on a CPU until the tty is unthrottled. schedule() does not
   really echedule, but returns immediately, of course.
2) when the sel_buffer becomes invalid, KASAN prevents any reads from it
   and the loop simply does not proceed and spins forever (causing the
   tty to throttle, but the code never sleeps, the same as above). This
   sometimes happens as there is a race in the sel_buffer handling code.

So add signal handling to this ioctl (TIOCL_PASTESEL) and return -EINTR
in case a signal is pending.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200210081131.23572-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-13 12:10:07 -08:00
..
.gitignore tty: vt: move conmakehash to drivers/tty/vt/ from scripts/ 2019-12-17 14:42:46 +01:00
Makefile kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
conmakehash.c tty: vt: move conmakehash to drivers/tty/vt/ from scripts/ 2019-12-17 14:42:46 +01:00
consolemap.c tty/vt: avoid high order pages allocation on GIO_UNIMAP ioctl 2019-04-16 15:21:34 +02:00
cp437.uni tty: fix up a few remaining files without SPDX identifiers 2019-04-04 18:48:43 +02:00
defkeymap.c_shipped tty: fix up a few remaining files without SPDX identifiers 2019-04-04 18:48:43 +02:00
defkeymap.map tty: fix up a few remaining files without SPDX identifiers 2019-04-04 18:48:43 +02:00
keyboard.c tty: vt: keyboard: reject invalid keycodes 2019-11-23 18:31:07 +01:00
selection.c vt: selection, handle pending signals in paste_selection 2020-02-13 12:10:07 -08:00
vc_screen.c vcs: prevent write access to vcsu devices 2019-11-27 07:47:17 +01:00
vt.c vt: fix scrollback flushing on background consoles 2020-02-10 13:51:44 -08:00
vt_ioctl.c vt: vt_ioctl: fix race in VT_RESIZEX 2020-02-12 11:53:23 -08:00