Eric Biggers
d9ef400374
devpts: fix error handling in devpts_mntget()
...
commit c9cc8d01fb04117928830449388512a5047569c9 upstream.
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>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 20:23:11 +01:00
..
2017-11-30 08:40:49 +00:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-14 09:53:15 +01:00
2017-12-20 10:10:17 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-16 20:23:09 +01:00
2017-11-02 11:10:55 +01:00
2017-12-20 10:10:19 +01:00
2018-02-16 20:22:43 +01:00
2017-11-24 08:37:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-30 08:40:44 +00:00
2017-07-15 12:00:42 -07:00
2018-02-16 20:23:11 +01:00
2017-11-02 11:10:55 +01:00
2017-11-30 08:40:45 +00:00
2017-07-11 06:09:21 -04:00
2017-11-02 11:10:55 +01:00
2017-09-07 11:59:42 -07:00
2017-11-02 11:10:55 +01:00
2017-12-20 10:10:22 +01:00
2017-12-14 09:53:14 +01:00
2017-12-05 11:26:29 +01:00
2017-11-02 11:10:55 +01:00
2017-10-25 16:34:27 +02:00
2017-12-20 10:10:29 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-03 07:39:19 -07:00
2017-11-30 08:40:45 +00:00
2017-07-07 19:38:17 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-16 20:22:59 +01:00
2018-02-03 17:39:08 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-16 20:22:59 +01:00
2018-02-03 17:39:08 +01:00
2018-02-03 17:39:08 +01:00
2017-11-30 08:40:44 +00:00
2017-11-02 11:10:55 +01:00
2017-11-30 08:40:47 +00:00
2017-11-02 11:10:55 +01:00
2017-11-24 08:37:04 +01:00
2017-11-02 11:10:55 +01:00
2018-01-31 14:03:43 +01:00
2018-02-16 20:23:10 +01:00
2018-02-16 20:23:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-02-03 17:39:11 +01:00
2017-09-06 17:27:26 -07:00
2018-02-03 17:39:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-07-06 03:31:46 -04:00
2018-02-16 20:22:57 +01:00
2017-12-20 10:10:36 +01:00
2017-11-02 11:10:55 +01:00
2018-02-03 17:39:15 +01:00
2017-09-14 19:29:55 -07: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-09-14 18:13:32 -07:00
2017-09-14 18:13:32 -07: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-10-13 16:18:33 -07:00
2017-11-30 08:40:45 +00:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-30 08:40:53 +00:00
2017-12-25 14:26:21 +01:00
2017-10-18 14:51:50 -04:00
2017-11-02 11:10:55 +01:00
2017-07-03 21:13:25 -07:00
2017-09-08 18:26:49 -07:00
2018-01-05 15:48:57 +01:00
2017-12-17 15:07:59 +01:00
2017-11-02 11:10:55 +01:00
2017-08-28 00:50:23 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-07-12 16:26:05 -07:00
2017-09-13 09:11:44 -07:00
2017-09-13 09:11:44 -07:00
2017-11-02 11:10:55 +01:00
2017-10-16 12:11:56 -07:00
2017-07-12 16:26:00 -07:00
2017-07-06 07:02:29 -04:00
2017-07-21 13:57:31 -04:00
2017-11-02 11:10:55 +01:00
2017-06-22 11:44:55 -04:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-05 11:26:29 +01:00
2018-02-03 17:38:53 +01:00
2017-11-02 11:10:55 +01:00
2017-09-05 12:53:12 +02:00
2018-02-16 20:23:05 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01: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-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-01-10 09:31:17 +01:00
2017-11-02 11:10:55 +01:00
2017-10-04 18:03:15 +11:00