Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri,  1 Sep 2017 17:35:57 +0200
From: Christian Brauner <>
Cc: Christian Brauner <>
Subject: [PATCH 0/1] openpty: use TIOCGPTPEER to open slave side fd


Newer kernels expose the ioctl TIOCGPTPEER [1] call to userspace which allows to
safely allocate a file descriptor for a pty slave based solely on the master
file descriptor. This allows us to avoid path-based operations and makes this
function a lot safer in the face of devpts mounts in different mount namespaces.


The way I wrote this patch it doesn't use the snprintf() and open() routine as a
fallback in case the ioctl() call fails. If this is a compatibility issue for
non-Linux systems I can rewrite. But the musl documentation gave me the
impression that this is not really a concern.

If possible, please Cc me on this since I'm not subscribed to the mailing list


Christian Brauner (1):
  openpty: use TIOCGPTPEER to open slave side fd

 src/misc/openpty.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.