From: Matthijs van Duin Date: Thu, 19 Jul 2018 08:43:46 +0000 (+0200) Subject: pty: fix O_CLOEXEC for TIOCGPTPEER X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4aec7c283904207d6dc2bd3a319d4e77ce60c77c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git pty: fix O_CLOEXEC for TIOCGPTPEER commit 36ecc1481dc8d8c52d43ba18c6b642c1d2fde789 upstream. It was being ignored because the flags were not passed to fd allocation. Fixes: 54ebbfb16034 ("tty: add TIOCGPTPEER ioctl") Signed-off-by: Matthijs van Duin Acked-by: Aleksa Sarai Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 899e8fe5e00f..9e26c530d2dd 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -625,7 +625,7 @@ int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags) if (tty->driver != ptm_driver) return -EIO; - fd = get_unused_fd_flags(0); + fd = get_unused_fd_flags(flags); if (fd < 0) { retval = fd; goto err;