Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4568821pxv; Tue, 29 Jun 2021 10:01:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx38dhZN90HdLhZ10nekmXn0ykvrU2vF4Nu4Jf497BgzrAX9Lo07QQf1cUj9wJrF+b0By2Y X-Received: by 2002:a50:d64a:: with SMTP id c10mr42608998edj.199.1624986065252; Tue, 29 Jun 2021 10:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624986065; cv=none; d=google.com; s=arc-20160816; b=Gh5UEk7NAZpa+gdXpciYvYDdBVdt67r5ED1lguffMXd/QyuY4ojiwrSP9C6AdeDMxK j2I/rv1xDOYy73epvLx9EHpAE29+Q+FkOvvSXo/uXz2cofg0wfwU6Xp3XMWtKgNfdN4B VsCEVsDD+u6b4pmayfVOdRs6QqS9jEA9X7Y3tiQ7q7LAVl/DvQkIDTQLLs08sohhX9il MHy+Yan3d3UjsnyPK9O8XNiC3ejXnzAhPj/m0Wvkqo3vwUUjiJTq/yDuYxI35pDb114i I8KPMOLRHU0eDqRzN5IIL9RjJAUlqcVRW8vthbB4pt/IkXlfQ9JpZZb59SG0dm9TnfVA ag/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=wJfMDu0KWNqGSC079Q1h8gastS4L2JtUsRRZlkHsj08=; b=XH4gJ9JbNW6NxUNDvvlg+0Ltcdy0MByF3HwWXKHA6s7aevWtMxHSJisVJytAJWPTxq XJ8u9YsEPGitSLoMx0PiicKDnHpp4DFaTN0mCivkusWmYiqUekDv2P4WK+gYgli3Mlci uivmbBZGu4QRlUWYvhyYVfFVM1PSbBGBqVeHx4w7n6i24PpgWVEQsvz5j8waixAvx1Kk geqEzLk9xEkaWMmTf+1l30yU8lu5MnuXkfxWnA5loJTZmDbJs/LmRA8qc3qSjvYGTU0n f043pJ3AGqwNHgl9jo8++hQmkubyjDWdL6Zljt/flGAj6jOkqfyruqvut70h44JRNG0D 3Pqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=T3AgipBM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si19020357edd.443.2021.06.29.10.00.37; Tue, 29 Jun 2021 10:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=T3AgipBM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232362AbhF2QQX (ORCPT + 99 others); Tue, 29 Jun 2021 12:16:23 -0400 Received: from sonic307-15.consmr.mail.ne1.yahoo.com ([66.163.190.38]:45556 "EHLO sonic307-15.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232358AbhF2QQV (ORCPT ); Tue, 29 Jun 2021 12:16:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1624983234; bh=wJfMDu0KWNqGSC079Q1h8gastS4L2JtUsRRZlkHsj08=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject:Reply-To; b=T3AgipBMAEnxNB+zeaN8RepsAom9LI2KbRRLCnTS5lRW6/Im3DXSxcTJFCuKBhzOi+/DgzF7s225BKRWGt4Oz+Jr1KYZLkJHT+z+hSaUEBG/BKvhGSf9AJ7wQKdZNZlZ4Vhjmgra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bVFykQKdn9udShHCvecRRahIRbsOFGOIlRdjPBJUUaW6xUeWOUmcN5 4vDcgHf9fqmtuzNMAMd44Usw- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Tue, 29 Jun 2021 16:13:54 +0000 Received: by kubenode565.mail-prod1.omega.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 70106849725f1c1225e29d7e29fd2cdb; Tue, 29 Jun 2021 16:13:51 +0000 (UTC) Subject: Re: [RFC PATCH 0/1] xattr: Allow user.* xattr on symlink/special files if caller has CAP_SYS_RESOURCE To: Vivek Goyal Cc: "Dr. David Alan Gilbert" , dwalsh@redhat.com, "Schaufler, Casey" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "viro@zeniv.linux.org.uk" , "virtio-fs@redhat.com" , "berrange@redhat.com" , linux-security-module , "selinux@vger.kernel.org" , Casey Schaufler References: <20210625191229.1752531-1-vgoyal@redhat.com> <20210628131708.GA1803896@redhat.com> <1b446468-dcf8-9e21-58d3-c032686eeee5@redhat.com> <5d8f033c-eba2-7a8b-f19a-1005bbb615ea@schaufler-ca.com> <20210629152007.GC5231@redhat.com> From: Casey Schaufler Message-ID: <78663f5c-d2fd-747a-48e3-0c5fd8b40332@schaufler-ca.com> Date: Tue, 29 Jun 2021 09:13:48 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210629152007.GC5231@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Mailer: WebService/1.1.18469 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Content-Length: 2031 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/29/2021 8:20 AM, Vivek Goyal wrote: > On Tue, Jun 29, 2021 at 07:38:15AM -0700, Casey Schaufler wrote: > > [..] >>>>>> User xattrs are less protected than security xattrs. You are expos= ing the >>>>>> security xattrs on the guest to the possible whims of a malicious,= unprivileged >>>>>> actor on the host. All it needs is the right UID. >>>>> Yep, we realise that; but when you're mainly interested in making s= ure >>>>> the guest can't attack the host, that's less worrying. >>>> That's uncomfortable. >>> Why exactly? >> If a mechanism is designed with a known vulnerability you >> fail your validation/evaluation efforts. > We are working with the constraint that shared directory should not be > accessible to unpriviliged users on host. And with that constraint, wha= t > you are referring to is not a vulnerability. Sure, that's quite reasonable for your use case. It doesn't mean that the vulnerability doesn't exist, it means you've mitigated it.=20 >> Your mechanism is >> less general because other potential use cases may not be >> as cavalier about the vulnerability. > Prefixing xattrs with "user.virtiofsd" is just one of the options. > virtiofsd has the capability to prefix "trusted.virtiofsd" as well. > We have not chosen that because we don't want to give it CAP_SYS_ADMIN.= > > So other use cases which don't like prefixing "user.virtiofsd", can > give CAP_SYS_ADMIN and work with it. > >> I think that you can >> approach this differently, get a solution that does everything >> you want, and avoid the known problem. > What's the solution? Are you referring to using "trusted.*" instead? Bu= t > that has its own problem of giving CAP_SYS_ADMIN to virtiofsd. I'm coming to the conclusion that xattr namespaces, analogous to user namespaces, are the correct solution. They generalize for multiple filesystem and LSM use cases. The use of namespaces is well understood, especially in the container community. It looks to me as if it would address your use case swimmingly. > > Thanks > Vivek >