Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932281AbcCILjw (ORCPT ); Wed, 9 Mar 2016 06:39:52 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34382 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932148AbcCILjm (ORCPT ); Wed, 9 Mar 2016 06:39:42 -0500 Date: Wed, 9 Mar 2016 12:40:51 +0100 From: Miklos Szeredi To: Seth Forshee Cc: "Eric W. Biederman" , Alexander Viro , Serge Hallyn , Richard Weinberger , Austin S Hemmelgarn , linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov Subject: Re: [PATCH RESEND v2 17/18] fuse: Restrict allow_other to the superblock's namespace or a descendant Message-ID: <20160309114051.GG8655@tucsk> References: <1451930639-94331-1-git-send-email-seth.forshee@canonical.com> <1451930639-94331-18-git-send-email-seth.forshee@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1451930639-94331-18-git-send-email-seth.forshee@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1259 Lines: 35 On Mon, Jan 04, 2016 at 12:03:56PM -0600, Seth Forshee wrote: > Unprivileged users are normally restricted from mounting with the > allow_other option by system policy, but this could be bypassed > for a mount done with user namespace root permissions. In such > cases allow_other should not allow users outside the userns > to access the mount as doing so would give the unprivileged user > the ability to manipulate processes it would otherwise be unable > to manipulate. Restrict allow_other to apply to users in the same > userns used at mount or a descendant of that namespace. > > Signed-off-by: Seth Forshee > Acked-by: Serge Hallyn Acked-by: Miklos Szeredi > --- > fs/fuse/dir.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c > index 8fd9fe4dcd43..24e4cdb554f1 100644 > --- a/fs/fuse/dir.c > +++ b/fs/fuse/dir.c > @@ -1015,7 +1015,7 @@ int fuse_allow_current_process(struct fuse_conn *fc) > const struct cred *cred; > > if (fc->flags & FUSE_ALLOW_OTHER) > - return 1; > + return current_in_userns(fc->user_ns); > > cred = current_cred(); > if (uid_eq(cred->euid, fc->user_id) && > -- > 1.9.1 >