Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751072AbcCHSS0 (ORCPT ); Tue, 8 Mar 2016 13:18:26 -0500 Received: from mail-ob0-f174.google.com ([209.85.214.174]:35432 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbcCHSSQ convert rfc822-to-8bit (ORCPT ); Tue, 8 Mar 2016 13:18:16 -0500 MIME-Version: 1.0 In-Reply-To: <1457428591.27353.55.camel@redhat.com> References: <1427447013.2250.9.camel@HansenPartnership.com> <1427788642.4411.12.camel@redhat.com> <1427807248.2117.117.camel@HansenPartnership.com> <1427808184.2117.122.camel@HansenPartnership.com> <1427810118.2117.126.camel@HansenPartnership.com> <1427810886.2117.129.camel@HansenPartnership.com> <1427811444.4411.20.camel@redhat.com> <1427969525.3559.120.camel@HansenPartnership.com> <1427984969.13651.11.camel@redhat.com> <87zj6qs7v8.fsf@x220.int.ebiederm.org> <87oal4odne.fsf@x220.int.ebiederm.org> <1432832511.21304.6.camel@redhat.com> <87siagh4kh.fsf@x220.int.ebiederm.org> <1457428591.27353.55.camel@redhat.com> From: Andy Lutomirski Date: Tue, 8 Mar 2016 10:17:56 -0800 Message-ID: Subject: Re: [PATCH] devpts: Add ptmx_uid and ptmx_gid options To: Alexander Larsson Cc: "Eric W. Biederman" , James Bottomley , gnome-os-list@gnome.org, Linux Containers , "linux-kernel@vger.kernel.org" , mclasen@redhat.com, Linux FS Devel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 34 On Tue, Mar 8, 2016 at 1:16 AM, Alexander Larsson wrote: > On mån, 2016-03-07 at 20:59 -0800, Andy Lutomirski wrote: >> On Thu, May 28, 2015 at 12:42 PM, Eric W. Biederman >> wrote: >> > Andy Lutomirski writes: >> > >> Apparently alexl is encountering some annoyances related to the >> current workaround, and the workaround is certainly ugly. > > It works, but it introduces an extra namespace that gets exposed to the > world, which is pretty ugly. For instance, entering the namespace > becomes hard. I can setns() into the intermediate user+mount namespace > without problems, but if i try to setns into the final user+mount ns > (it gets its own implicit mount ns) i get EPERM. I'm not sure exactly > why though... > >> Your proposal seems like it could break some use cases involving >> fscaps on a mount or mount-like binary. >> >> What if we change it to use the owner of the userns that owns the >> current mount ns? For anything that doesn't explicitly use >> namespaces, this will be zero. For namespace users, it should do the >> right thing. > > Any of these is fine with me. One nice thing would if i could somehow > detect whether this was supported or not so that i can fall back on the > old workaround. I'll send a patch. I suppose the straightforward, if slightly awkward, way to detect it is just to try it -- create a namespace and try to mount devpts. --Andy