Jann Horn
742f306229
tty: Fix ->pgrp locking in tiocspgrp()
...
commit 54ffccbf05 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 >
2020-12-11 13:37:59 +01:00
..
2020-11-22 09:58:15 +01:00
2020-08-21 11:01:55 +02:00
2020-11-10 10:23:51 +01:00
2020-11-24 13:02:52 +01:00
2020-11-10 10:24:00 +01:00
2020-01-29 10:24:31 +01:00
2020-11-18 18:26:30 +01:00
2020-01-12 11:24:16 +01:00
2020-04-24 07:58:46 +02:00
2020-11-18 18:26:29 +01:00
2020-11-10 10:23:54 +01:00
2020-10-01 20:40:17 +02:00
2020-11-10 10:23:56 +01:00
2020-06-20 10:24:18 +02:00
2020-10-29 09:05:41 +01:00
2020-10-01 20:40:02 +02:00
2020-12-02 08:31:26 +01:00
2020-10-29 09:05:32 +01:00
2020-06-30 15:38:28 -04:00
2020-01-12 11:24:19 +01:00
2020-07-09 09:35:57 +02:00
2020-10-14 09:48:12 +02:00
2020-11-18 18:26:28 +01:00
2020-12-02 08:31:26 +01:00
2020-09-23 08:46:15 +02:00
2020-09-12 11:47:32 +02:00
2020-04-02 17:20:25 +02:00
2020-11-22 09:58:14 +01:00
2020-09-12 11:47:36 +02:00
2020-11-24 13:03:07 +01:00
2020-12-11 13:37:58 +01:00
2020-12-11 13:37:58 +01:00
2020-11-18 18:26:27 +01:00
2020-07-22 09:10:54 +02:00
2020-11-10 10:23:56 +01:00
2020-06-20 10:24:21 +02:00
2020-11-10 10:23:55 +01:00
2020-11-10 10:23:53 +01:00
2020-11-10 10:23:55 +01:00
2020-11-10 10:23:57 +01:00
2020-10-29 09:05:44 +01:00
2020-11-18 18:26:28 +01:00
2020-11-10 10:23:53 +01:00
2020-11-10 10:23:59 +01:00
2020-12-11 13:37:57 +01:00
2020-12-02 08:31:27 +01:00
2020-10-29 09:05:41 +01:00
2020-09-12 11:47:36 +02:00
2020-10-29 09:05:41 +01:00
2020-06-11 09:22:22 +02:00
2020-11-18 18:26:27 +01:00
2020-08-21 11:02:06 +02:00
2020-12-02 08:31:25 +01:00
2020-12-02 08:31:27 +01:00
2020-12-11 13:37:58 +01:00
2020-12-02 08:31:28 +01:00
2020-11-10 10:23:54 +01:00
2020-11-10 21:04:57 +01:00
2020-05-20 08:15:33 +02:00
2020-08-21 11:02:10 +02:00
2020-10-29 09:05:39 +01:00
2020-12-02 08:31:29 +01:00
2020-05-02 17:23:14 +02:00
2020-11-10 10:23:59 +01:00
2020-09-03 11:21:19 +02:00
2020-12-02 08:31:27 +01:00
2020-04-24 07:59:10 +02:00
2020-12-11 13:37:58 +01:00
2020-11-10 10:24:01 +01:00
2020-12-02 08:31:26 +01:00
2020-09-12 11:47:34 +02:00
2020-12-11 13:37:59 +01:00
2020-07-22 09:10:53 +02:00
2020-12-11 13:37:59 +01:00
2020-10-29 09:05:40 +01:00
2020-11-10 10:23:59 +01:00
2020-12-02 08:31:27 +01:00
2020-10-29 09:05:35 +01:00
2020-08-26 10:29:05 +02:00
2020-02-28 15:42:33 +01:00
2020-11-10 10:23:57 +01:00
2020-11-10 10:23:54 +01:00
2020-11-18 18:26:31 +01:00