Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp822607yba; Fri, 3 May 2019 11:01:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdlLU2AHTUjPLh7M8StwZNYW6L4f9b9Cs4ldxQvlzziBqLCyN5Da10gc4vMlAPEoQnMUUX X-Received: by 2002:a62:160b:: with SMTP id 11mr11668066pfw.88.1556906507463; Fri, 03 May 2019 11:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556906507; cv=none; d=google.com; s=arc-20160816; b=ARg7MGoMX9KiHT9Mj/7M4KQD5lOjxVVQRA42g6ykGQ7aXyhQb+6Gz2UxZ19zMVdZRJ +5enI36i3AawCUgHSDDUl6Ux4lNBgy8JhMA7I+igRD+uwyF+VuTJX9I2Jp7OazzqBt0V xCsOB+FgEnEmM7uww/fCwuMZMj0Xhatd5ssWYkbXScKmQB+C8W2ISc/zzXOcS01OSdBj 272yvhWIvvIy3/2rGRG75moAE4ONw0+Nwg83VWJdBBeOVIggzjQ0IexBKRX6NY1F421G rlyDSUUMK4ol0px9MkdRqvUUiKLKB5mQvlCPzcfMlSbM1RmDEsZePM5WEZHlejvwgDhC kWFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=p5M/unB0351EktCmdlsfTYqv7wEGQrmXxJ+Scs6yVQc=; b=A7gQO6mgWFDuHFWjAsyIhhXLw7AlC0kCJiz0cZs0uW5ayj5/SpyxUf4qg98Ek8gilM WiAdi1yUaOIiKPGIsIkF8TQj605czR1Y7VhAAgb4+s0g1kpvUk/5fFnApRGya2+2PEZH BIod56Cai3lVEzrmUFD5UmHIiZihIzOaUnnzKTBKRnVUfQpzAfwBRbKHIlPZtKBV+BnY Sm4aoObcravWPQpIovtb1N30Hc3luElgC4MMgJ9wqlCbHuLuHp7uy4yDjfVzK9tl6EXA Ka/EFh6YGo3l83d7U1nV4jqsRb9gupbBvDT5MHG2SlN/hURnyqCPtvH95T2jXDPpHo9g qTsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kFuDZSBW; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si3402610pgr.577.2019.05.03.11.01.32; Fri, 03 May 2019 11:01:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kFuDZSBW; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbfECRli (ORCPT + 99 others); Fri, 3 May 2019 13:41:38 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:37922 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbfECRli (ORCPT ); Fri, 3 May 2019 13:41:38 -0400 Received: by mail-yw1-f68.google.com with SMTP id b74so4797204ywe.5; Fri, 03 May 2019 10:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=p5M/unB0351EktCmdlsfTYqv7wEGQrmXxJ+Scs6yVQc=; b=kFuDZSBWEO8l1xntay2cfVEMTDQa1wvYAE1OQwdwbDXRNs0fMP1U0cXxiH7LIpcTUv jNCaiX94xhfp/Y69DiOejHn8716trG86YKnhQWH1SVwvrr1vqDHxfm0LAwJS10137egx 3eIJLGZAbvZmIP1OjDxSFgs5fq4EYaAgj4WK6uwIP/Lo5EnfiTVTpKzcEvDlglPk3cMf p9axbDEf4E6UbouMJ048GZz0F3fulolXT4SGRq4/ErH5LqSIqqwY+XL5QozamFOjawCe ClTP6v6aA5vLbZ+MoUFEA8D0uFdEpWYLcB+fIWyC/bOdfRTOajuaPChKqI4GLgZLuh+d +k3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=p5M/unB0351EktCmdlsfTYqv7wEGQrmXxJ+Scs6yVQc=; b=Gfy1nis42n2y1Ly+hwIodqcwSZ4xfsedDdsDnjbkqyxtJj1De4yEV96SWuyP21A1Pc Xp9bzNhPICCSVqRXf3GP7KaNdFOKyyYoVpBnhHUxa7gdLl1peiON6gb0uToqkO54wigM lQC6ktLA1SqCTnRN6I2xFFCt1oLnhNJYe2mBmxpykxKVmfNHCg+QzXH8gl3FNtV60utH ZG2z40+hdTHlPJC/dPJppsM8oBPNOzvhVuSQFWfCKbtck5SgpboZG1aIIteZWQEEzIJ3 Hex80BdMvs3aJaz8u9opn1Y2/2dSQf0BOVTDaFK65W9Si2DPfBWi3/xmi3UyzSK4If4p 7eAg== X-Gm-Message-State: APjAAAV5zFPbyTCxr6xDbxV43LMB8vlOXXAYBxs6XD1bH1OU4NkkVG2H MRYRx1lvFG9MGlNR9cPhj0s+iPYa9zL/vyNuobJgeOaB X-Received: by 2002:a81:7c4:: with SMTP id 187mr8665382ywh.176.1556905297030; Fri, 03 May 2019 10:41:37 -0700 (PDT) MIME-Version: 1.0 References: <266c571f-e4e2-7c61-5ee2-8ece0c2d06e9@web.de> <20161206185806.GC31197@fieldses.org> <87bm0l4nra.fsf@notabene.neil.brown.name> <20190503153531.GJ12608@fieldses.org> <20190503173133.GB14954@fieldses.org> In-Reply-To: <20190503173133.GB14954@fieldses.org> From: Amir Goldstein Date: Fri, 3 May 2019 13:41:25 -0400 Message-ID: Subject: Re: [PATCH] overlayfs: ignore empty NFSv4 ACLs in ext4 upperdir To: "J. Bruce Fields" Cc: NeilBrown , Andreas Gruenbacher , Miklos Szeredi , =?UTF-8?Q?Andreas_Gr=C3=BCnbacher?= , Patrick Plagwitz , "linux-unionfs@vger.kernel.org" , Linux NFS list , Linux FS-devel Mailing List , Linux Kernel Mailing List , Vivek Goyal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, May 3, 2019 at 1:31 PM J. Bruce Fields wrote= : > > On Fri, May 03, 2019 at 01:26:01PM -0400, Amir Goldstein wrote: > > On Fri, May 3, 2019 at 12:03 PM J. Bruce Fields = wrote: > > > > > > On Thu, May 02, 2019 at 12:02:33PM +1000, NeilBrown wrote: > > > > On Tue, Dec 06 2016, J. Bruce Fields wrote: > > > > > > > > > On Tue, Dec 06, 2016 at 02:18:31PM +0100, Andreas Gruenbacher wro= te: > > > > >> On Tue, Dec 6, 2016 at 11:08 AM, Miklos Szeredi wrote: > > > > >> > On Tue, Dec 6, 2016 at 12:24 AM, Andreas Gr=C3=BCnbacher > > > > >> > wrote: > > > > >> >> 2016-12-06 0:19 GMT+01:00 Andreas Gr=C3=BCnbacher : > > > > >> > > > > > >> >>> It's not hard to come up with a heuristic that determines if= a > > > > >> >>> system.nfs4_acl value is equivalent to a file mode, and to i= gnore the > > > > >> >>> attribute in that case. (The file mode is transmitted in its= own > > > > >> >>> attribute already, so actually converting .) That way, overl= ayfs could > > > > >> >>> still fail copying up files that have an actual ACL. It's st= ill an > > > > >> >>> ugly hack ... > > > > >> >> > > > > >> >> Actually, that kind of heuristic would make sense in the NFS = client > > > > >> >> which could then hide the "system.nfs4_acl" attribute. > > > > >> > > > > > >> > Even simpler would be if knfsd didn't send the attribute if no= t > > > > >> > necessary. Looks like there's code actively creating the nfs4= _acl on > > > > >> > the wire even if the filesystem had none: > > > > >> > > > > > >> > pacl =3D get_acl(inode, ACL_TYPE_ACCESS); > > > > >> > if (!pacl) > > > > >> > pacl =3D posix_acl_from_mode(inode->i_mode, GFP_KERNEL= ); > > > > >> > > > > > >> > What's the point? > > > > >> > > > > >> That's how the protocol is specified. > > > > > > > > > > Yep, even if we could make that change to nfsd it wouldn't help t= he > > > > > client with the large number of other servers that are out there > > > > > (including older knfsd's). > > > > > > > > > > --b. > > > > > > > > > >> (I'm not saying that that's very helpful.) > > > > >> > > > > >> Andreas > > > > > > > > Hi everyone..... > > > > I have a customer facing this problem, and so stumbled onto the em= ail > > > > thread. > > > > Unfortunately it didn't resolve anything. Maybe I can help kick t= hings > > > > along??? > > > > > > > > The core problem here is that NFSv4 and ext4 use different and lar= gely > > > > incompatible ACL implementations. There is no way to accurately > > > > translate from one to the other in general (common specific exampl= es > > > > can be converted). > > > > > > > > This means that either: > > > > 1/ overlayfs cannot use ext4 for upper and NFS for lower (or vic= e > > > > versa) or > > > > 2/ overlayfs need to accept that sometimes it cannot copy ACLs, = and > > > > that is OK. > > > > > > > > Silently not copying the ACLs is probably not a good idea as it mi= ght > > > > result in inappropriate permissions being given away. So if the > > > > sysadmin wants this (and some clearly do), they need a way to > > > > explicitly say "I accept the risk". > > > > > > So, I feel like silently copying ACLs up *also* carries a risk, if th= at > > > means switching from server-enforcement to client-enforcement of thos= e > > > permissions. > > > > > > Sorry, I know we had another thread recently about permissions in thi= s > > > situation, and I've forgotten the conclusion. > > > > > > Out of curiosity, what's done with selinux labels? > > > > > > > overlayfs calls security_inode_copy_up_xattr(name) which > > can fail (<0) allow (0) or skip(1). > > > > selinux_inode_copy_up_xattr() as well as smack_inode_copy_up_xattr() > > skip their own xattr on copy up and fail any other xattr copy up. > > If it's OK to silently skip copying up security labels, maybe it's OK to > silently skip NFSv4 ACLs too? > I think overlayfs inode security context is taken from overlayfs mount parameters (i.e. per container context) and therefore the lower security. xattr are ignored (CC Vivek). Thanks, Amir.