Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966397AbcCPMdO (ORCPT ); Wed, 16 Mar 2016 08:33:14 -0400 Received: from mail-prod-route02.it.su.se ([77.238.35.140]:34824 "EHLO mail-prod-route02.it.su.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308AbcCPMdM (ORCPT ); Wed, 16 Mar 2016 08:33:12 -0400 X-Greylist: delayed 542 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Mar 2016 08:33:11 EDT Date: Wed, 16 Mar 2016 13:24:04 +0100 From: Sergio Gelato To: Jiri Slaby Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, NeilBrown Subject: Re: [PATCH 3.12 01/58] nfsd: fix problem with setting ACL on directories Message-ID: <20160316122404.GA22901@hanuman.astro.su.se> References: <377b71e18f20d69b0df301ce7040554f40ba9651.1458125909.git.jslaby@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <377b71e18f20d69b0df301ce7040554f40ba9651.1458125909.git.jslaby@suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) X-Bayes-Prob: 0.0001 (Score 0, tokens from: outbound, outbound-su-se:default, su-se:default, base:default, @@RPTN) X-Spam-Score: -0.10 () [Tag at 7.50] T_RP_MATCHES_RCVD:-0.1 X-CanIt-Geo: ip=130.237.166.19; country=SE; region=Stockholm; city=Stockholm; latitude=59.3333; longitude=18.0500; http://maps.google.com/maps?q=59.3333,18.0500&z=6 X-CanItPRO-Stream: outbound-su-se:outbound (inherits from outbound-su-se:default,su-se:default,base:default) X-Canit-Stats-ID: 09QuAo5cQ - 2f28a9baf2aa - 20160316 X-CanIt-Archive-Cluster: PfMRe/vJWMiXwM2YIH5BVExnUnw Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1515 Lines: 41 * Jiri Slaby [2016-03-16 11:58:46 +0100]: > From: NeilBrown > > 3.12-stable review patch. If anyone has any objections, please let me know. > If a non-inherited ACL is set on a directory, nfsd will try to set the Posix > default ACL to NULL. This gets converted to "" by generic_setxattr(). > As "" is not a valid posix acl attribute value, this results in an error. > > So instead of setting the xattr to NULL, remove it. There is similar code in nfsd_set_posix_acl() further down in the same source file which skips the vfs_removexattr() call for default ACLs on non-directories (there shouldn't be too many of these) and ignores ENODATA returns from vfs_removexattr(). Are these precautions guaranteed to be unnecessary here in set_nfsv4_acl_one() ? > Fixes: ba1816b40a ("nfsd: fix NFS regression") > Signed-off-by: NeilBrown > Cc: Sergio Gelato > Signed-off-by: Jiri Slaby > --- > fs/nfsd/vfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c > index fafac65804d6..e5f146c7c871 100644 > --- a/fs/nfsd/vfs.c > +++ b/fs/nfsd/vfs.c > @@ -510,7 +510,7 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key) > int error = 0; > > if (!pacl) > - return vfs_setxattr(dentry, key, NULL, 0, 0); > + return vfs_removexattr(dentry, key); > > buflen = posix_acl_xattr_size(pacl->a_count); > buf = kmalloc(buflen, GFP_KERNEL); > -- > 2.7.3 >