Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp951407pxv; Fri, 9 Jul 2021 13:12:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXMKy/nJ0Rb2akIZ4P9cMDC7axaALCVeqYOGw4p8cq3G7C3P3ta1jmqFEZl8nOWToV2dQT X-Received: by 2002:a17:906:1b41:: with SMTP id p1mr19220361ejg.486.1625861525564; Fri, 09 Jul 2021 13:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625861525; cv=none; d=google.com; s=arc-20160816; b=L/4iePGjbUAgfbaeVgcd79yhsy1CEVVQPrqsgXSxH0IU2dNBshzAIZpGzqVkD3LCHF vNBxEYuYZNwWFJA1/47ePR2Z1ZLntZ8pyDbmHnr8cJ64huD1+nZHc8IZGjgBVgR2Gt/n XktNoifWqhi0w5Re3xSAsRYI0aionVEsYfz5LbibKf3/aCHxyris5BOTr7bUebUq4Zo1 KEeSesOn5dnceD+EXUC3JjbPMOLo8y1BmAKzdeytTBJ1Znm415HahBga8st7eV1YmCf/ gRb+81MNAOaNDskDVwsmFTjoIx1Axw0PbFPRZ6hCH4gZXdSP1e7CsV3xrqYzjV4wKnKd Xcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aLMvAaz+yv2TTm+67q7hZDRIjKdaFQ3tWITvUUMiGNA=; b=dWCY7aUziOyWpSI4a2uuZAmxqnIOzB/srKLzPomRAsV51DRNNbjEF8RL7z+0Gicne+ OsGHtj4WOL6/pEwmjuoMz2qvBmq9jo9DqoCQt8S4gdn4+oimIzm96tB+hAQ2P0qw7msm BBSaUf5BAgnE0zIMj94mcaT5HYy7Z73nMm1lU9F5qzjWBW1UOKUW3kQYLB2tU5gHMDHG FiRo0UTojW8yl6sgTCTK0Vxi83kv0yMOTJlDiv4gFFSxHthRYsudC3a6o9Cnnp6rxnvx OBYpdcXKT5/QNuDoD5+uE8PxjhLh+oWQTTOHiPiuxBWvt0Z4TAUrUAn9OJIslnRLO1xU lsbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FsOZKb8+; 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 ds17si9539603ejc.467.2021.07.09.13.11.42; Fri, 09 Jul 2021 13:12: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=@redhat.com header.s=mimecast20190719 header.b=FsOZKb8+; 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 S229750AbhGIUNS (ORCPT + 99 others); Fri, 9 Jul 2021 16:13:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55241 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229948AbhGIUNR (ORCPT ); Fri, 9 Jul 2021 16:13:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625861429; 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=aLMvAaz+yv2TTm+67q7hZDRIjKdaFQ3tWITvUUMiGNA=; b=FsOZKb8+OIEw/mA+fBQtRpEjsi6sZesMS3rGcLcGVCT8tvhCQ9GpkSudUUINF1o4o9v8MU lRY46wPg7yen5VstIR1XVk+YN6dXESnJYzHVu/67dn+5Z68fSm0TI7ksb+vKUqCo1qj5Ho 6o3WT2w5drPNnojSc5pyg51h3jqmD/s= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-ThF17IbMPQ-jjKVZ6-9ZEQ-1; Fri, 09 Jul 2021 16:10:28 -0400 X-MC-Unique: ThF17IbMPQ-jjKVZ6-9ZEQ-1 Received: by mail-il1-f199.google.com with SMTP id a5-20020a056e020e05b02901ef113bb0fcso6660250ilk.16 for ; Fri, 09 Jul 2021 13:10:27 -0700 (PDT) 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; bh=aLMvAaz+yv2TTm+67q7hZDRIjKdaFQ3tWITvUUMiGNA=; b=MIlDCoxJRkEMtRMqKw4rtS8XqqI8sBJ8QPpvGNAoR9gkMuzu21wJeWGH8sLX2YlXgk sNUlTAuCteKpiwI2CMsAcO+QBGywAD3RU/vWWB/KbZ2axL/2TmjoV6DKe+WDB5v8y9r1 EcB4l5bxCRP27RX0tfxgBmvghUixCsYsUwltiqR0hzTIWiyfYiBlx9U4Hqrm2fa3hOzy TO1zIjGwU5Kbenkas7gLME0OFlPbgdyMK0KzTCDZsg0ZrF+ZEUajunNIfnPAMXJZnmUW WhxjVcHfClWdgFzgYyLiz+YgjWyTcQtZG7zq5WK6FDPplYZ5hOJxLoK9zoPuziSKjwqu VYlQ== X-Gm-Message-State: AOAM530ItTmJoDNKX1OWezysJxl0/GE1lmDzLasoXm9PJg01KEJq2ZC6 2O+0/w1U9Fj4UoiAXOTwumU4jfVbhXH5tHg+Tb14W0oujA2ab/0KdX53vBB152xyKmd6lG4mssN xDtR8wB5JivdwC8P80nE8z9JH/yCt+3yyI6i3cLbi X-Received: by 2002:a5d:840c:: with SMTP id i12mr29354936ion.185.1625861427498; Fri, 09 Jul 2021 13:10:27 -0700 (PDT) X-Received: by 2002:a5d:840c:: with SMTP id i12mr29354915ion.185.1625861427360; Fri, 09 Jul 2021 13:10:27 -0700 (PDT) MIME-Version: 1.0 References: <20210708175738.360757-1-vgoyal@redhat.com> <20210708175738.360757-2-vgoyal@redhat.com> <20210709091915.2bd4snyfjndexw2b@wittgenstein> <20210709152737.GA398382@redhat.com> <710d1c6f-d477-384f-0cc1-8914258f1fb1@schaufler-ca.com> <20210709175947.GB398382@redhat.com> In-Reply-To: <20210709175947.GB398382@redhat.com> From: Bruce Fields Date: Fri, 9 Jul 2021 16:10:16 -0400 Message-ID: Subject: Re: [PATCH v2 1/1] xattr: Allow user.* xattr on symlink and special files To: Vivek Goyal Cc: Casey Schaufler , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, virtio-fs@redhat.com, dwalsh@redhat.com, dgilbert@redhat.com, casey.schaufler@intel.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, tytso@mit.edu, miklos@szeredi.hu, gscrivan@redhat.com, jack@suse.cz, Christoph Hellwig Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 9, 2021 at 1:59 PM Vivek Goyal wrote: > nfs seems to have some issues. I'm not sure what the expected behavior is for nfs. All I have for now is some generic troubleshooting ideas, sorry: > - I can set user.foo xattr on symlink and query it back using xattr name. > > getfattr -h -n user.foo foo-link.txt > > But when I try to dump all xattrs on this file, user.foo is being > filtered out it looks like. Not sure why. Logging into the server and seeing what's set there could help confirm whether it's the client or server that's at fault. (Or watching the traffic in wireshark; there are GET/SET/LISTXATTR ops that should be easy to spot.) > - I can't set "user.foo" xattr on a device node on nfs and I get > "Permission denied". I am assuming nfs server is returning this. Wireshark should tell you whether it's the server or client doing that. The RFC is https://datatracker.ietf.org/doc/html/rfc8276, and I don't see any explicit statement about what the server should do in the case of symlinks or device nodes, but I do see "Any regular file or directory may have a set of extended attributes", so that was clearly the assumption. Also, NFS4ERR_WRONG_TYPE is listed as a possible error return for the xattr ops. But on a quick skim I don't see any explicit checks in the nfsd code, so I *think* it's just relying on the vfs for any file type checks. --b.