Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp124032imu; Wed, 12 Dec 2018 13:27:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/WZ3ncGCnJ+3QgpHZsI0v7yNsxsYsWArmA00TrexpgscyKPQiqr+tQk89nLrMvwyYBehgst X-Received: by 2002:a62:1f53:: with SMTP id f80mr21633030pff.92.1544650032811; Wed, 12 Dec 2018 13:27:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544650032; cv=none; d=google.com; s=arc-20160816; b=0DFb94uhBMznJV6jKqBlNq4R3loK8cEPjAy2MpTHqP55CaY0uWS3dTK2BPr8/1q2kd pTKNWKPMN7dKQBql5DVdaRwLkXOOkdBINcIHcccwi9dB2JSEbXEZf8v8yhN9dmNmXaMD N1VpAMShJeuDdgzdVcsJU+LSMbBwYnEhPCSokXoQdGBkoX495r37Ho3rxjU5zFMKzKC0 BuehAq1MqwN5oSlCZqDo0imN8QhLK3QogT4PWcCWMxa9Lh6fRwf1ShQqq+knjHdkkoaW LspQzwnQZuwZMw+YpVhk+X9HgFg/wnb3pMhmqOseTk5FTmzxNOfheBIIRP86uRFh4Sqq mYIA== 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=9lxdor84ylUnNzRM/60jxgZELgC5Ggjr47T0WempzFA=; b=aYXiAS5fhsRUJ4P6rfA6y1LP2kvxgh7gvstjWLyIrtfvhV2FFRbevl5hLd+Eh2fTbC 76zsEq766f+4fLuleTnrDMvrT2OqlQkBSGjNvZ0YuUpvBxvrcrXrd4suY0GkTguRm8Rx 5fgwDBE+G+1YWm4MLTuBv/7wIO8FAkCxuYUJpi+i5lJobYN53OhDZWJYucUDCm0Wr+Cc RoqWNxFCmrtN5hadIJya3GERuJCbO0DAl5Y5nXYy1ylc+clLbUf/vWTnbheXps5/G26U 4ZiWCgchsjstylhPl6MjbzgjnSqHu0RXiwb6byotKdkrmK9fjJOWw8+DdV4DqC5uNe/Q ncGg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si14575445pgh.289.2018.12.12.13.26.57; Wed, 12 Dec 2018 13:27:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727848AbeLLVZ5 (ORCPT + 99 others); Wed, 12 Dec 2018 16:25:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37978 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726263AbeLLVZ5 (ORCPT ); Wed, 12 Dec 2018 16:25:57 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68C3230BFA3D; Wed, 12 Dec 2018 21:25:56 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.234]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEA6D608D9; Wed, 12 Dec 2018 21:25:53 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 5A34B2208FC; Wed, 12 Dec 2018 16:25:53 -0500 (EST) Date: Wed, 12 Dec 2018 16:25:53 -0500 From: Vivek Goyal To: Piotr Jurkiewicz Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kvm@vger.kernel.org, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, sweil@redhat.com, swhiteho@redhat.com Subject: Re: [PATCH 00/52] [RFC] virtio-fs: shared file system for virtual machines Message-ID: <20181212212553.GB23229@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 12 Dec 2018 21:25:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 12, 2018 at 06:07:40PM +0100, Piotr Jurkiewicz wrote: > Currently, virtio-9p cannot be used with overlayfs in order to obtain > Docker-like experience (but with separate kernel) because of file attributes > problems. I wrote an email about that to qemu-devel almost year ago, but it > received no attention (I attach its contents below.). > > Will virtio-fs avoid these problems? I assume it will be transparent from > the point of view of file attributes, and not enforce any kind of security > filtering? Hi Piotr, So you want to use virtio-fs as upper/ layer of a overlay filesystem inside guest? Interesting. I have not tried that. As of now I think we are not doing any filtering of file attributes and it might just work. Give it a try. Having said that, I suspect that security model of virtio-fs most likely will evolve. Thanks Vivek > > Piotr Jurkiewicz > > ---- > > 1. Upper filesystem must support the creation of trusted.* extended > attributes. > > 9pfs has support for getting/setting xattrs, but calls operating on > attributes other than user.* and system.posix_acl_* are dropped. > > 2. Upper filesystem must provide valid d_type in readdir responses. > > This works, but only in case of 'passtrough' and 'none' security models. In > the case of 'mapped-xattr' and 'mapped-file' models, d_type is being zeroed > to DT_UNKNOWN during readdir() call. > > All these limitations can be resolved pretty easily, but requires some > design decisions. I can prepare appropriate patches. > > Ad. 1. > > Why are operations on attributes other than than user.* and > system.posix_acl_* forbidden? Is this due to security reasons? > > If so, can we map all of them to user.virtfs namespace, similarly as > system.posix_acl_* are being mapped to user.virtfs.system.posix_acl_* in > 'mapping' mode already? This way any trusted/security/system attributes will > be effective only when mounted via virtfs inside VM. > > Ad. 2. > > local_readdir() can fill entry->d_type with the right DT_* value by > obtaining file type from mapping and translating it with IFTODT() macro. > This would, however, require reading 'user.virtfs.mode' for each direntry > during readdir() call, what can affect performance. If so, this behavior > would probably need to be controlled with some runtime option. > > 'mapped-xattr' and 'mapped-file' models are essential for running qemu with > overlayfs as non-root, because overlayfs creates device nodes, what is > possible for unprivileged user only with these models.