public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pty: fix O_CLOEXEC for TIOCGPTPEER
@ 2018-07-19  8:43 Matthijs van Duin
  2018-07-19 17:18 ` Aleksa Sarai
  0 siblings, 1 reply; 2+ messages in thread
From: Matthijs van Duin @ 2018-07-19  8:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: linux-kernel, Aleksa Sarai, Arnd Bergmann, Eric W Biederman

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 <matthijsvanduin@gmail.com>
---
 drivers/tty/pty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index b0e2c4847a5d..678406e0948b 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;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pty: fix O_CLOEXEC for TIOCGPTPEER
  2018-07-19  8:43 [PATCH] pty: fix O_CLOEXEC for TIOCGPTPEER Matthijs van Duin
@ 2018-07-19 17:18 ` Aleksa Sarai
  0 siblings, 0 replies; 2+ messages in thread
From: Aleksa Sarai @ 2018-07-19 17:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby, linux-kernel, Arnd Bergmann,
	Eric W Biederman

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

On 2018-07-19, Matthijs van Duin <matthijsvanduin@gmail.com> wrote:
> It was being ignored because the flags were not passed to fd allocation.
> 
> Fixes: 54ebbfb16034 ("tty: add TIOCGPTPEER ioctl")

Acked-by: Aleksa Sarai <asarai@suse.de>

> Signed-off-by: Matthijs van Duin <matthijsvanduin@gmail.com>
> ---
>  drivers/tty/pty.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
> index b0e2c4847a5d..678406e0948b 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;

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-19 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19  8:43 [PATCH] pty: fix O_CLOEXEC for TIOCGPTPEER Matthijs van Duin
2018-07-19 17:18 ` Aleksa Sarai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox