Date: Tue, 14 Sep 2021 10:32:13 -0400 From: Vivek Goyal Message-ID: References: <79dcd300-a441-cdba-e523-324733f892ca@schaufler-ca.com> <3bca47d0-747d-dd49-a03f-e0fa98eaa2f7@schaufler-ca.com> <1f33e6ef-e896-09ef-43b1-6c5fac40ba5f@schaufler-ca.com> <496e92bf-bf9e-a56b-bd73-3c1d0994a064@schaufler-ca.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Virtio-fs] [PATCH v3 0/1] Relax restrictions on user.* xattr List-Id: Development discussions about virtio-fs List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bruce Fields Cc: Giuseppe Scrivano , Theodore Ts'o , Andreas Gruenbacher , Miklos Szeredi , selinux@vger.kernel.org, stephen.smalley.work@gmail.com, Dave Chinner , LKML , virtio-fs@redhat.com, linux-fsdevel , LSM , Alexander Viro , Casey Schaufler , Christian Brauner , Casey Schaufler On Tue, Sep 14, 2021 at 09:59:19AM -0400, Bruce Fields wrote: > On Tue, Sep 14, 2021 at 8:52 AM Vivek Goyal wrote: > > Same is the requirement for regular containers and that's why > > podman (and possibly other container managers), make top level > > storage directory only readable and searchable by root, so that > > unpriveleged entities on host can not access container root filesystem > > data. > > Note--if that directory is on NFS, making it readable and searchable > by root is very weak protection, since it's often possible for an > attacker to guess filehandles and access objects without the need for > directory lookups. open_by_handle_at() requires CAP_DAC_READ_SEARCH. And if you have CAP_DAC_READ_SEARCH, you don't need to even guess file handles. You should be able to read/search through all directories, IIUC. So how does one make sure that shared directory on host is not accessible to unprivileged entities. If making directory accessible to root only is weaker security, what are the options for stronger security. Vivek