Eric Biggers
c9cc8d01fb
devpts: fix error handling in devpts_mntget()
...
If devpts_ptmx_path() returns an error code, then devpts_mntget()
dereferences an ERR_PTR():
BUG: unable to handle kernel paging request at fffffffffffffff5
IP: devpts_mntget+0x13f/0x280 fs/devpts/inode.c:173
Fix it by returning early in the error paths.
Reproducer:
#define _GNU_SOURCE
#include <fcntl.h>
#include <sched.h>
#include <sys/ioctl.h>
#define TIOCGPTPEER _IO('T', 0x41)
int main()
{
for (;;) {
int fd = open("/dev/ptmx", 0);
unshare(CLONE_NEWNS);
ioctl(fd, TIOCGPTPEER, 0);
}
}
Fixes: 311fc65c9fb9 ("pty: Repair TIOCGPTPEER")
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: <stable@vger.kernel.org> # v4.13+
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-01-31 08:48:37 -08:00
..
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2018-01-29 06:42:20 -05:00
2018-01-29 13:33:53 -08:00
2018-01-30 14:43:12 -08:00
2017-11-27 13:05:09 -08:00
2017-11-02 11:10:55 +01:00
2018-01-29 14:04:23 -08:00
2017-11-27 16:20:05 -05:00
2017-12-08 11:07:12 +01:00
2018-01-28 09:19:45 -06:00
2018-01-30 17:58:07 -08:00
2017-10-19 16:15:16 +02:00
2017-12-17 12:20:58 -08:00
2017-11-14 11:35:15 -08:00
2017-11-27 16:20:05 -05:00
2018-01-31 08:48:37 -08:00
2018-01-30 18:59:03 -08:00
2018-01-30 17:58:07 -08:00
2017-07-11 06:09:21 -04:00
2017-11-27 13:05:09 -08:00
2018-01-29 06:42:20 -05:00
2017-03-03 11:38:56 -08:00
2018-01-29 06:42:20 -05:00
2018-01-29 13:33:53 -08:00
2018-01-30 19:07:32 -08:00
2018-01-29 06:42:20 -05:00
2017-11-27 13:05:09 -08:00
2017-11-16 11:41:22 -08:00
2018-01-30 17:58:07 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-02 11:10:55 +01:00
2017-12-10 12:58:18 -08:00
2017-11-29 18:40:43 -08:00
2017-11-27 13:05:09 -08:00
2017-11-17 09:51:57 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2018-01-30 17:58:07 -08:00
2018-01-24 17:33:57 -05:00
2017-11-27 13:05:09 -08:00
2018-01-30 18:59:03 -08:00
2018-01-30 19:03:48 -08:00
2017-11-27 16:45:11 -05:00
2018-01-29 13:33:53 -08:00
2017-11-27 13:05:09 -08:00
2017-11-02 11:10:55 +01:00
2018-01-30 17:58:07 -08:00
2018-01-01 10:09:33 -05:00
2018-01-30 18:59:03 -08:00
2017-11-02 11:10:55 +01:00
2017-11-27 13:05:09 -08:00
2018-01-30 17:58:07 -08:00
2017-12-14 11:14:52 +01:00
2018-01-30 17:58:07 -08:00
2017-11-21 15:57:05 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-29 16:46:48 +01:00
2017-09-06 17:27:26 -07:00
2017-11-30 18:38:47 -05:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-07-06 03:31:46 -04:00
2018-01-18 00:18:49 +01:00
2017-11-27 13:05:09 -08:00
2018-01-29 06:42:21 -05:00
2018-01-29 13:33:53 -08:00
2017-11-17 11:54:55 -08:00
2016-12-24 11:46:01 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-09-04 19:05:15 -04:00
2017-11-17 12:54:01 -08:00
2017-11-16 12:50:35 -08:00
2017-11-02 11:10:55 +01:00
2017-10-13 16:18:33 -07:00
2017-10-03 17:54:25 -07:00
2017-11-14 15:32:19 -08:00
2018-01-06 09:18:00 -07:00
2017-11-02 11:10:55 +01:00
2017-02-01 09:13:51 +01:00
2017-11-17 12:54:01 -08:00
2017-04-17 12:52:27 -04:00
2017-11-17 11:54:55 -08:00
2017-12-15 18:53:22 -08:00
2017-12-04 10:52:52 -08:00
2016-12-24 11:46:01 -08:00
2017-11-14 15:32:19 -08:00
2017-11-02 11:10:55 +01:00
2017-11-27 16:20:05 -05:00
2017-11-28 19:56:15 -05:00
2018-01-03 10:13:36 -08:00
2018-01-30 17:58:07 -08:00
2017-11-17 12:54:01 -08:00
2017-11-15 18:21:04 -08:00
2017-12-04 10:28:59 -08:00
2017-11-02 11:10:55 +01:00
2017-11-07 10:32:44 +01:00
2017-03-02 08:42:35 +01:00
2018-01-06 09:18:00 -07:00
2018-01-29 06:42:21 -05:00
2017-11-10 08:48:46 -05:00
2017-11-02 11:10:55 +01:00
2017-11-17 12:08:18 -08:00
2017-07-12 16:26:00 -07:00
2017-09-10 19:31:46 -04:00
2017-11-27 13:05:09 -08:00
2017-11-27 13:05:09 -08:00
2017-11-02 11:10:55 +01:00
2017-11-29 18:40:43 -08:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-30 18:32:21 -08:00
2017-12-09 20:16:33 -05:00
2017-11-27 13:05:09 -08:00
2017-09-05 12:53:12 +02:00
2017-11-27 16:20:05 -05:00
2017-05-23 08:41:17 -05:00
2017-02-04 00:01:06 +13:00
2018-01-02 19:27:28 -08:00
2018-01-30 17:58:07 -08:00
2017-11-17 12:08:18 -08:00
2017-11-07 10:32:44 +01:00
2017-11-29 19:00:41 -05:00
2017-11-02 11:10:55 +01:00
2017-11-27 16:20:05 -05:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-27 13:05:09 -08:00
2017-12-18 15:05:07 -05:00
2017-11-14 15:32:19 -08:00
2017-11-27 16:20:05 -05:00
2018-01-30 17:58:07 -08:00
2017-11-02 11:10:55 +01:00
2017-10-04 18:03:15 +11:00