From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH v2 0/3] fuse: Add support for mounts from pid/user namespaces Date: Thu, 25 Sep 2014 11:05:36 -0700 Message-ID: <87wq8reftb.fsf@x220.int.ebiederm.org> References: <1409672696-15847-1-git-send-email-seth.forshee@canonical.com> <20140910123525.GA29064@ubuntu-hedt> <20140910162155.GA7748@mail.hallyn.com> <20140910164212.GA32587@ubuntu-hedt> <20140911181034.GA58733@ubuntu-hedt> <87d2am3r8a.fsf@x220.int.ebiederm.org> <20140924132925.GA48721@ubuntu-hedt> <87y4t9ndw5.fsf@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain Cc: "Serge E. Hallyn" , Alexander Viro , Serge Hallyn , fuse-devel , Kernel Mailing List , Linux-Fsdevel To: Miklos Szeredi Return-path: Received: from out03.mta.xmission.com ([166.70.13.233]:46538 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753293AbaIYSGC (ORCPT ); Thu, 25 Sep 2014 14:06:02 -0400 In-Reply-To: (Miklos Szeredi's message of "Thu, 25 Sep 2014 17:04:04 +0200") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Miklos Szeredi writes: > On Wed, Sep 24, 2014 at 7:10 PM, Eric W. Biederman > wrote: > > >> So in summary I see: >> - Low utility in being able to manipulate files with bad uids. >> - Bad uids are mostly likely malicious action. >> - make_bad_inode is trivial to analyze. >> - No impediments to change if I am wrong. >> >> So unless there is a compelling case, right now I would recommend >> returning -EIO initially. That allows us to concentrate on the easier >> parts of this and it leaves the changes only in fuse. > > The problem with marking the inode bad is that it will mark it bad for > all instances of this filesystem. Including ones which are in a > namespace where the UIDs make perfect sense. There are two cases: app <-> fuse fuse <-> server I proposed mark_bad_inode for "userspace server -> fuse". Where we have one superblock and one server so and one namespace that they decide to talk in when the filesystem was mounted. I think bad_inode is a reasonable response when the filesystem server starts spewing non-sense. > So that really doesn't look like a good solution. > > Doing the check in inode_permission() might be too heavyweight, but > it's still the only one that looks sane. For the "app <-> fuse" case we already have checks in inode_permision that are kuid based that handle that case. We use kuids not for performance (although there is a small advatnage) but to much more to keep the logic simple and maintainable. For the "app -> fuse" case in .setattr we do need a check to verify that the uid and gid are valid. However that check was added with the basic user namespace support and fuse current returns -EOVERFLOW when that happens. Eric