Jann Horn
37f5700deb
tty: Fix ->pgrp locking in tiocspgrp()
...
commit 54ffccbf053b5b6ca4f6e45094b942fab92a25fc upstream.
tiocspgrp() takes two tty_struct pointers: One to the tty that userspace
passed to ioctl() (`tty`) and one to the TTY being changed (`real_tty`).
These pointers are different when ioctl() is called with a master fd.
To properly lock real_tty->pgrp, we must take real_tty->ctrl_lock.
This bug makes it possible for racing ioctl(TIOCSPGRP, ...) calls on
both sides of a PTY pair to corrupt the refcount of `struct pid`,
leading to use-after-free errors.
Fixes: 47f86834bb ("redo locking of tty->pgrp")
CC: stable@kernel.org
Signed-off-by: Jann Horn <jannh@google.com >
Reviewed-by: Jiri Slaby <jirislaby@kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Lee Jones <lee.jones@linaro.org >
Change-Id: Ib41dbafa06012374b219c7236968733373189ffd
CVE-2020-29661
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org >
2021-06-14 10:34:44 +02:00
..
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
2020-09-23 18:05:05 +02:00
2020-12-09 16:03:14 +01:00
2019-08-05 14:20:47 +02:00
2015-09-10 10:50:52 +05:30
2020-05-20 09:44:22 +02:00
2019-08-05 14:21:57 +02:00
2019-08-06 12:26:35 +02:00
2021-02-10 10:58:45 +01:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:21:53 +02:00
2019-08-05 14:20:47 +02:00
2019-08-08 15:00:19 +02:00
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
2019-08-06 12:31:22 +02:00
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
2019-08-06 11:41:21 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 09:13:25 +02:00
2019-08-09 10:00:22 +02:00
2019-08-05 09:13:27 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2021-02-10 10:59:08 +01:00
2021-04-16 12:12:57 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2020-03-07 14:01:44 +01:00
2019-08-06 08:17:38 +02:00
2019-08-05 14:20:47 +02:00
2019-08-06 10:44:59 +02:00
2020-11-09 11:01:32 +01:00
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
2020-05-20 09:44:18 +02:00
2020-11-16 10:35:54 +01:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2020-11-09 11:01:32 +01:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2020-05-20 15:00:46 +02:00
2019-08-23 13:20:00 +02:00
2020-03-07 14:01:44 +01:00
2019-08-06 10:44:59 +02:00
2020-05-20 09:44:21 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-06 10:44:59 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2020-08-08 16:42:21 +02:00
2019-08-05 14:20:47 +02:00
2020-11-16 10:36:14 +01:00
2019-08-05 14:20:47 +02:00
2019-08-02 15:14:10 +02:00
2019-08-05 14:20:47 +02:00
2019-08-23 13:20:00 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2019-08-06 12:31:33 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2020-03-07 14:01:44 +01:00
2019-08-08 15:25:13 +02:00
2019-08-08 10:42:14 +02:00
2019-08-06 11:48:23 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 11:18:51 +02:00
2019-08-05 14:20:47 +02:00
2020-09-23 17:32:06 +02:00
2019-08-06 12:26:35 +02:00
2019-08-06 12:31:35 +02:00
2021-06-14 10:34:44 +02:00
2020-09-23 18:05:04 +02:00
2019-08-05 14:20:47 +02:00
2019-08-05 14:20:47 +02:00
2020-08-08 16:41:32 +02:00
2019-08-05 14:20:47 +02:00
2019-08-06 11:41:21 +02:00
2019-08-05 14:20:47 +02:00
2019-08-06 10:44:59 +02:00
2019-08-08 12:10:20 +02:00
2020-03-07 14:01:44 +01:00