Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3420368pxf; Mon, 29 Mar 2021 01:32:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtE4UI1Z7zrIHthudHEppVMTSLuBFIqVLGtNoQXRWBZcyWK2q9ZlDxCHw2MSw6EhT4EOro X-Received: by 2002:aa7:dc15:: with SMTP id b21mr27497033edu.350.1617006746736; Mon, 29 Mar 2021 01:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006746; cv=none; d=google.com; s=arc-20160816; b=YiHoDvYy+t790nU5CISbHilfV1XAVxeR7ccnDr9b/kZ8Yp1MRewroaIDPB9P//2W1N efnwmvceS7TW8ifIuM0uQRLu+n+iZtBQ/3ORZV2ypzHR/6PRW+dY+4xiqZIG7Mzq1+P4 1nGHEYd7i4niisaEv+oq0rx55SluiSxiuKyDl40cKd/lexBCluazKYJI8XJbD/CRqu+A 0PX4Ef6NQpaIYmYMA5X+1EU8Vh5ytisFL9aGmVL9i1gueg64yHXaz8oyIuvbuI/y13+r SvmMeTGzJpweQmRTEo8MvoxrSlj7csHC63qjGRKIS0ZHZ/d+iGyRb5g/RpxdiZ+ydhJQ wbBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5Zm8QQaTknhWxDzEhSp0sen8qTB+DxMKxy84NrJItnw=; b=ig1+WjAyhjeLCOI72cTb0aiqMFwGXtF/Dmbo2V0DywPeWsxz03YEK2NluM9NzKhoe7 3NOzM7tla4xTqNFdJRZRZELskeLLVCCMDlWRCh7RKn3H7mHlAH4hmkMdH33sxY3/lyoz qkhPhLrPbvCw3HSi3FWEcGOn9MTMPcm54V461joRxJI40xGFRhkqLGe0hZ2sppnpfUYi FCvKpSG7o/6rU8ykZh16VBA0GR7z0MxHo5nnLU/HEXmdATEJDUWDSgWHrpMhM7urYM4F sXXX185U0USr41fBCkHfJj+SWD4ClGzl5NB7AZm2pnL45rmCQiq+nWajdYg+rmlAGKNi OfFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w2y14N1A; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb35si12122276ejc.351.2021.03.29.01.32.04; Mon, 29 Mar 2021 01:32:26 -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=@linuxfoundation.org header.s=korg header.b=w2y14N1A; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234735AbhC2I26 (ORCPT + 99 others); Mon, 29 Mar 2021 04:28:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:35168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231484AbhC2ISl (ORCPT ); Mon, 29 Mar 2021 04:18:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 007F861601; Mon, 29 Mar 2021 08:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005920; bh=F92fXOvGK6sqPT6GAX9IwjiAu0qeL13R2TYVYlrvM/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w2y14N1AeNryREJgA1vHjsXXO5w5lm8VLMZ7Drto97Q7tT9/Ef/fTFpclOcwLZ/tT zh+JYf9bCQxyAXlduaT8oyzCcTI69gMfiznge3YzrnVIKxmQCAu3KHxQ9gcQ/7ZMJ2 UuydcvibF8xMVH84/h/V+1oSeGwoSPpe9h2qyP38= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "J. Bruce Fields" , Anna Schumaker , Sasha Levin Subject: [PATCH 5.10 052/221] nfs: we dont support removing system.nfs4_acl Date: Mon, 29 Mar 2021 09:56:23 +0200 Message-Id: <20210329075630.916357973@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: J. Bruce Fields [ Upstream commit 4f8be1f53bf615102d103c0509ffa9596f65b718 ] The NFSv4 protocol doesn't have any notion of reomoving an attribute, so removexattr(path,"system.nfs4_acl") doesn't make sense. There's no documented return value. Arguably it could be EOPNOTSUPP but I'm a little worried an application might take that to mean that we don't support ACLs or xattrs. How about EINVAL? Signed-off-by: J. Bruce Fields Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/nfs4proc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ba2dfba4854b..15ac6b6893e7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5891,6 +5891,9 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE); int ret, i; + /* You can't remove system.nfs4_acl: */ + if (buflen == 0) + return -EINVAL; if (!nfs4_server_supports_acls(server)) return -EOPNOTSUPP; if (npages > ARRAY_SIZE(pages)) -- 2.30.1