Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp454897pxv; Thu, 1 Jul 2021 01:52:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKAUUB+0i/b2unBmlVbDmIUYA1Xl4Bhmn9xRjk/UGIf48YXRZyKsJxSyATsiXRtBrVE/Oe X-Received: by 2002:a17:907:9496:: with SMTP id dm22mr68940ejc.437.1625129577386; Thu, 01 Jul 2021 01:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625129577; cv=none; d=google.com; s=arc-20160816; b=sLRQam5CUbl05c3fzkidfXPUn+tE/qtVjLWdfIIQSXJb+QbHte1dK7QrqB+nqXTuCM CLJohbmP76OBD5sujqSXrdxsqpFZMFasmc25XuRdSPehudTdQT7Eyg+1Kn0RfbkzHtZZ e1FZsiDFCWOxymOUGJOd97wdTBoy/sM3xEwqmNLiMzwAWi+ClazfG7naHUVaJxiyaKR2 E1Sr1X0sI8p33ExKkVFybVFq0J3cljT5X4Op1bMOpdpUKfpwnXvQcQAbl91FPGbhKMi4 ihT4GNsjFl/xwYqLmlDPaxaeFj9HJpSeYgdi/VwVKDJubO0GKvFrAV1++F2p1mdTIoC/ Xo2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=FWtBsSNWOGoBz0joLRACuRfxa8gzRbsAHo0rqGyAWsA=; b=XsEjxhsBEhMNDibVLxHN+0E/331DfWvcNVv/bAE8nzAE9Z4+WMCHl61Rpn7qdlaGWA BRHfG9H4WlV7u9Xe0WYlSuO5VA5djMdpXpU6gcUqxf/M4lNknb0XMilc/MILp+8yo6qW jnXng/OH/oMebuCiHcXZAjA2+646KL5MofrxeQtDuOoxmhRfB1O8zh1mW3Op/5xbHwO+ 0mVh1aa0z7UIIbdx2oL8jCRZHoOVxMqD35u4rcjWELXuM3njk2qG/qEq5e43rue2sRWm LlyAA6ySjwDkRwZGs9LPsjp+6nbR83lhW8NrZ/0z+MoE1HveQ4xkuv2CYcPydfsII/X/ e31w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hMuf6H63; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si24633102edu.115.2021.07.01.01.52.33; Thu, 01 Jul 2021 01:52:57 -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=@redhat.com header.s=mimecast20190719 header.b=hMuf6H63; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235356AbhGAIvK (ORCPT + 99 others); Thu, 1 Jul 2021 04:51:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:50946 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235088AbhGAIvJ (ORCPT ); Thu, 1 Jul 2021 04:51:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625129319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FWtBsSNWOGoBz0joLRACuRfxa8gzRbsAHo0rqGyAWsA=; b=hMuf6H639mp4Id89omSVWeUcprotIWsXv2Y2hwMEWUx2D4VtYNcfivkA8h2OWiMFedBlPF tAvMuWNVYU4sey43SFEa8/PL6EllA7rkGCYkSkWaG9DzrPbFi1JWZCRISuoYbqDAjgKYzl ymBVx9CAmhNN2wOVpAcTictE0e7o4e0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-620RDs9PNbytv0WcCTPRlg-1; Thu, 01 Jul 2021 04:48:37 -0400 X-MC-Unique: 620RDs9PNbytv0WcCTPRlg-1 Received: by mail-wr1-f72.google.com with SMTP id l12-20020a5d410c0000b029012b4f055c9bso2022313wrp.4 for ; Thu, 01 Jul 2021 01:48:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FWtBsSNWOGoBz0joLRACuRfxa8gzRbsAHo0rqGyAWsA=; b=mbUfRy89XnLfnm+PZPAGqpkl3e2teKgPaCV4yfb+aQ/UsAQaZKQIl45s9CXgy4LUIB FPcPc2d1r7/O1gr7EPEDLnf9heZ0HjQGqO0TD2wdAzSPnMDbi7z8bmrvnyBbpMKCIg87 +bEt43w2XeKg6UgCEmRRvS5fcCVhTNZ0ujWBi9TbB91T76zn0tPNf6y7PmB5ob+d6eJp FQLO/VDy+ASJOzoc7VY8Ay6UUgHofIdCGfKTx7FCz51cPTMG1/Xm3Jpd2bxi1yr006DI Fk1E/5wI8X8Eo6hUb1lZ0zHzr4EGSr/U45pnBdjnf6GVgExQ0qGOKRdzc4qR5pd+aljD k2dA== X-Gm-Message-State: AOAM533JxJC5hgOSAdK5X3Mk6Aq15K6gcd7eObRkaxA1FvCvcLEdD7F3 GyENfVhpMzERYBOhChiC4GMUN1wkPReRDzDJDDKAjAfMsOCj6Pg4Z1dp2kmkSfR1qQDJnBBoBwC MYrVj8N4c3PPIV9ifkIWlFCow X-Received: by 2002:a05:6000:2c4:: with SMTP id o4mr43144749wry.79.1625129316787; Thu, 01 Jul 2021 01:48:36 -0700 (PDT) X-Received: by 2002:a05:6000:2c4:: with SMTP id o4mr43144730wry.79.1625129316604; Thu, 01 Jul 2021 01:48:36 -0700 (PDT) Received: from work-vm (cpc109021-salf6-2-0-cust453.10-2.cable.virginm.net. [82.29.237.198]) by smtp.gmail.com with ESMTPSA id y7sm6730729wro.51.2021.07.01.01.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 01:48:35 -0700 (PDT) Date: Thu, 1 Jul 2021 09:48:33 +0100 From: "Dr. David Alan Gilbert" To: Theodore Ts'o Cc: Daniel Walsh , Vivek Goyal , Casey Schaufler , "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" Subject: Re: [RFC PATCH 0/1] xattr: Allow user.* xattr on symlink/special files if caller has CAP_SYS_RESOURCE Message-ID: References: <20210629152007.GC5231@redhat.com> <78663f5c-d2fd-747a-48e3-0c5fd8b40332@schaufler-ca.com> <20210629173530.GD5231@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Theodore Ts'o (tytso@mit.edu) wrote: > On Wed, Jun 30, 2021 at 04:01:42PM +0100, Dr. David Alan Gilbert wrote: > > > > Even if you fix symlinks, I don't think it fixes device nodes or > > anything else where the permissions bitmap isn't purely used as the > > permissions on the inode. > > I think we're making a mountain out of a molehill. Again, very few > people are using quota these days. And if you give someone write > access to a 8TB disk, do you really care if they can "steal" 32k worth > of space (which is the maximum size of an xattr, enforced by the VFS). > > OK, but what about character mode devices? First of all, most users > don't have access to huge number of devices, but let's assume > something absurd. Let's say that a user has write access to *1024* > devices. (My /dev has 233 character mode devices, and I have write > access to well under a dozen.) > > An 8TB disk costs about $200. So how much of the "stolen" quota space > are we talking about, assuming the user has access to 1024 devices, > and the file system actually supports a 32k xattr. > > 32k * 1024 * $200 / 8TB / (1024*1024*1024) = $0.000763 = 0.0763 cents > > A 2TB SSD is less around $180, so even if we calculate the prices > based on SSD space, we're still talking about a quarter of a penny. > > Why are we worrying about this? I'm not worrying about storage cost, but we would need to define what the rules are on who can write and change a user.* xattr on a device node. It doesn't feel sane to make it anyone who can write to the device; then everyone can start leaving droppings on /dev/null. The other evilness I can imagine, is if there's a 32k limit on xattrs on a node, an evil user could write almost 32k of junk to the node and then break the next login that tries to add an acl or breaks the next relabel. Dave > - Ted > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK