Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712659

Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation

From Aleksa Sarai <asarai@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation
Date 2017-08-16 06:50 +0200
Message-ID <ueYrf-2sr-3@gated-at.bofh.it> (permalink)
References <tQvA6-4gT-13@gated-at.bofh.it> <uePHj-5pa-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> I've applied this patch, and then tweaked the wording a little. Could
> you please check the following text:
> 
>         TIOCGPTPEER    int flags
>                (since Linux 4.13) Given  a  file  descriptor  in  fd  that
>                refers  to  a  pseudoterminal  master, open (with the given
>                open(2)-style flags) and return a new file descriptor  that
>                refers to the peer pseudoterminal slave device.  This oper‐
>                ation can be performed regardless of whether  the  pathname
>                of  the  slave  device  is  accessible  through the calling
>                process's mount namespaces.
> 
>                Security-conscious programs interacting with namespaces may
>                wish  to  use  this  operation rather than open(2) with the
>                pathname returned by ptsname(3), and similar library  func‐
>                tions that have insecure APIs.

Yup, that sounds good.

> I also have a question on the last sentence: what are the "similar library
> functions that have insecure APIs"? It's not clear to me what you are
> referring to here.

There are a few posix_-style functions provided by glibc that are just 
wrappers around the open+ptsname combo that I mention earlier in the 
sentence (and thus are vulnerable to the same issue). But if you feel 
it's confusing you can feel free to drop it.

Thanks.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2017-08-15 21:30 +0200
  Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation Aleksa Sarai <asarai@suse.de> - 2017-08-16 06:50 +0200
  Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation ebiederm@xmission.com (Eric W. Biederman) - 2017-08-16 18:50 +0200
    Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation Aleksa Sarai <asarai@suse.de> - 2017-08-16 19:00 +0200
      Re: [PATCH] ioctl_tty.2: add TIOCGPTPEER documentation ebiederm@xmission.com (Eric W. Biederman) - 2017-08-16 19:20 +0200

csiph-web