Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp100751ybv; Tue, 18 Feb 2020 18:43:16 -0800 (PST) X-Google-Smtp-Source: APXvYqzftxo+NMzaQh3ycy89fsSKW/BOOOAy/0RoxJZ4Ud+1Pgf1cQSk3c1ugSUEdg6wOxGPEx9o X-Received: by 2002:a9d:7a56:: with SMTP id z22mr16987446otm.201.1582080196300; Tue, 18 Feb 2020 18:43:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582080196; cv=none; d=google.com; s=arc-20160816; b=TiKzY9CMwXc6b0Hzpt1lXABaWLE954m6QIVeFkwLeDJvahBTnxPCvgnVwZDWQk3+kg q7YccVB07XeR4IM3o81TOCMTuCEcYenPh+hSt1DIkv+Yg6Ars03cciyL99JRogLyEMNA c6SnYL5OBg1SqxXnoHtuJfEhQci+j84njWlWfy3vVSdCeSyHDA0NjY1CKttFBp9rwmmw 2Evdy021mpzNGXcla5EUX7F9+B3Qogebx5vHGX9e5ZfeposUsLxSvb08apfr6nbrWWY6 zB2y8pCflDBEAVH8HExtMKvWRn7ZfrInRtGye/nFnm6PAPpEfwIFDmJXd9AAp7Iw2bWL c6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=gaGfJ7pfpstyM2jPlxG8U5Ar7vxy+b63m2fFW9y9f1I=; b=YjGNgGSk3FRwa1WPO1cKSSnUQOg3r0yCq81qE5a+U+837VkNYVL6Ac/gtgpH38uVQW dUAl/EIfJdSzWgTYqbsy1h5mhGvsvS4QwcK5K7JKHFam57t8AxhxmbCMd0nDKtKiszTP aG8g0B5g7gYKPsnXTaCsPjEWfelJ8cJXZk/BjBXFqBMWKkjlhCYFM0tZHt63ONPiML1l sP6t4RREkcX/V4QFjAtszIQ7pBpyBr40QdV+DrdtOU3CSmfHYfHo5e2exvR0XCnLkJyD 4bD7yIAB4PxxMhOrCts1q7MLRhoZI11UI7zn6FpnlMHxC1Pbb791VKvl9GnZgsthVCWW hHcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u16si363192otq.92.2020.02.18.18.43.04; Tue, 18 Feb 2020 18:43:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbgBSCmf (ORCPT + 99 others); Tue, 18 Feb 2020 21:42:35 -0500 Received: from mail.hallyn.com ([178.63.66.53]:49664 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727187AbgBSCmf (ORCPT ); Tue, 18 Feb 2020 21:42:35 -0500 Received: by mail.hallyn.com (Postfix, from userid 1001) id 170EEB83; Tue, 18 Feb 2020 20:42:33 -0600 (CST) Date: Tue, 18 Feb 2020 20:42:33 -0600 From: "Serge E. Hallyn" To: Christian Brauner Cc: =?iso-8859-1?Q?St=E9phane?= Graber , "Eric W. Biederman" , Aleksa Sarai , Jann Horn , smbarber@chromium.org, Seth Forshee , Alexander Viro , Alexey Dobriyan , Serge Hallyn , James Morris , Kees Cook , Jonathan Corbet , Phil Estes , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org, linux-security-module@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v3 09/25] fs: add is_userns_visible() helper Message-ID: <20200219024233.GA19334@mail.hallyn.com> References: <20200218143411.2389182-1-christian.brauner@ubuntu.com> <20200218143411.2389182-10-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200218143411.2389182-10-christian.brauner@ubuntu.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 03:33:55PM +0100, Christian Brauner wrote: > Introduce a helper which makes it possible to detect fileystems whose > superblock is visible in multiple user namespace. This currently only > means proc and sys. Such filesystems usually have special semantics so their > behavior will not be changed with the introduction of fsid mappings. Hi, I'm afraid I've got a bit of a hangup about the terminology here. I *think* what you mean is that SB_I_USERNS_VISIBLE is an fs whose uids are always translated per the id mappings, not fsid mappings. But when I see the name it seems to imply that !SB_I_USERNS_VISIBLE filesystems can't be seen by other namespaces at all. Am I right in my first interpretation? If so, can we talk about the naming? > Signed-off-by: Christian Brauner > --- > /* v2 */ > unchanged > > /* v3 */ > unchanged > --- > include/linux/fs.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/fs.h b/include/linux/fs.h > index 3cd4fe6b845e..fdc8fb2d786b 100644 > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -3651,4 +3651,9 @@ static inline int inode_drain_writes(struct inode *inode) > return filemap_write_and_wait(inode->i_mapping); > } > > +static inline bool is_userns_visible(unsigned long iflags) > +{ > + return (iflags & SB_I_USERNS_VISIBLE); > +} > + > #endif /* _LINUX_FS_H */ > -- > 2.25.0