android_kernel_xiaomi_sm8450/drivers/tty
Adrian Reber 6f921430b0 tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE
[ Upstream commit e0f25b8992345aa5f113da2815f5add98738c611 ]

The capability CAP_CHECKPOINT_RESTORE was introduced to allow non-root
users to checkpoint and restore processes as non-root with CRIU.

This change extends CAP_CHECKPOINT_RESTORE to enable the CRIU option
'--shell-job' as non-root. CRIU's man-page describes the '--shell-job'
option like this:

  Allow one to dump shell jobs. This implies the restored task will
  inherit session and process group ID from the criu itself. This option
  also allows to migrate a single external tty connection, to migrate
  applications like top.

TIOCSLCKTRMIOS can only be done if the process has CAP_SYS_ADMIN and
this change extends it to CAP_SYS_ADMIN or CAP_CHECKPOINT_RESTORE.

With this change it is possible to checkpoint and restore processes
which have a tty connection as non-root if CAP_CHECKPOINT_RESTORE is
set.

Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Adrian Reber <areber@redhat.com>
Acked-by: Andrei Vagin <avagin@gmail.com>
Link: https://lore.kernel.org/r/20231208143656.1019-1-areber@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 08:42:14 +01:00
..
hvc hvc/xen: fix error path in xen_hvc_init() to always register frontend driver 2023-11-28 16:54:56 +00:00
ipwireless
serdev
serial serial: sc16is7xx: add check for unsupported SPI modes during probe 2024-02-23 08:41:51 +01:00
vt vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF 2023-05-30 12:57:55 +01:00
amiserial.c
cyclades.c tty: drivers/tty/, stop using tty_schedule_flip() 2022-07-29 17:19:27 +02:00
ehv_bytechan.c
goldfish.c tty: drivers/tty/, stop using tty_schedule_flip() 2022-07-29 17:19:27 +02:00
isicom.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c tty: drivers/tty/, stop using tty_schedule_flip() 2022-07-29 17:19:27 +02:00
moxa.h
mxser.c mxser: fix xmit_buf leak in activate when LSR == 0xff 2022-04-08 14:40:23 +02:00
mxser.h
n_gsm.c tty: n_gsm: add sanity check for gsm->receive in gsm_receive_buf() 2023-12-20 15:44:41 +01:00
n_hdlc.c tty: clean include/linux/tty.h up 2023-05-17 11:48:09 +02:00
n_null.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
nozomi.c
pty.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
rocket_int.h
rocket.c
rocket.h
synclink_gt.c tty: synclink_gt: Fix null-pointer-dereference in slgt_clean() 2022-06-14 18:32:41 +02:00
synclink.c
synclinkmp.c
sysrq.c tty/sysrq: replace smp_processor_id() with get_cpu() 2023-11-28 16:54:56 +00:00
tty_audit.c tty: audit: move some local functions out of tty.h 2023-05-17 11:48:08 +02:00
tty_baudrate.c tty: clean include/linux/tty.h up 2023-05-17 11:48:09 +02:00
tty_buffer.c tty: move some internal tty lock enums and functions out of tty.h 2023-05-17 11:48:08 +02:00
tty_io.c usb: cdc-acm: return correct error code on unsupported break 2024-01-25 14:37:54 -08:00
tty_ioctl.c tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE 2024-02-23 08:42:14 +01:00
tty_jobctrl.c tty: tty_jobctrl: fix pid memleak in disassociate_ctty() 2023-11-20 11:06:52 +01:00
tty_ldisc.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
tty_ldsem.c
tty_mutex.c tty: move some internal tty lock enums and functions out of tty.h 2023-05-17 11:48:08 +02:00
tty_port.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
tty.h tty: change tty_write_lock()'s ndelay parameter to bool 2024-01-25 14:37:54 -08:00
ttynull.c
vcc.c tty: vcc: Add check for kstrdup() in vcc_probe() 2023-11-28 16:54:52 +00:00