From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934602AbdBQSQU (ORCPT ); Fri, 17 Feb 2017 13:16:20 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50790 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934274AbdBQSQR (ORCPT ); Fri, 17 Feb 2017 13:16:17 -0500 Date: Fri, 17 Feb 2017 10:15:38 -0800 From: Greg KH To: Florian Weimer Cc: linux-api@vger.kernel.org, Christian Brauner , linux-kernel@vger.kernel.org, jslaby@suse.com Subject: Re: Hard-coding PTY device node numbers in userspace Message-ID: <20170217181538.GA9346@kroah.com> References: <87bmu1jd0j.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87bmu1jd0j.fsf@mid.deneb.enyo.de> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 17, 2017 at 12:02:52PM +0100, Florian Weimer wrote: > We want to reject PTY devices from other namespaces as valid input to > the ttyname and ttyname_r functions, while still providing a hint to > callers that the device is, in fact, a PTY. Christian Brauner wrote a > glibc patch for this: > > > > It hard-codes the major PTY device number range. Is this feasible? > Is it part of the stable userspace ABI for the TTY subsystem? What major numbers are you using in the patch '2' and '3'? And yes, major numbers are static and you should be fine to rely on them. But can't you test that the device is a pty to verify it? thanks, greg k-h