]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSD: NFSv4 file creation neglects setting ACL
authorChuck Lever <chuck.lever@oracle.com>
Wed, 19 Nov 2025 00:51:19 +0000 (19:51 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:23 +0000 (12:57 +0100)
commit 913f7cf77bf14c13cfea70e89bcb6d0b22239562 upstream.

An NFSv4 client that sets an ACL with a named principal during file
creation retrieves the ACL afterwards, and finds that it is only a
default ACL (based on the mode bits) and not the ACL that was
requested during file creation. This violates RFC 8881 section
6.4.1.3: "the ACL attribute is set as given".

The issue occurs in nfsd_create_setattr(), which calls
nfsd_attrs_valid() to determine whether to call nfsd_setattr().
However, nfsd_attrs_valid() checks only for iattr changes and
security labels, but not POSIX ACLs. When only an ACL is present,
the function returns false, nfsd_setattr() is skipped, and the
POSIX ACL is never applied to the inode.

Subsequently, when the client retrieves the ACL, the server finds
no POSIX ACL on the inode and returns one generated from the file's
mode bits rather than returning the originally-specified ACL.

Reported-by: Aurélien Couderc <aurelien.couderc2002@gmail.com>
Fixes: c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc: Roland Mainz <roland.mainz@nrubsig.org>
Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/vfs.h

index 0c0292611c6de3daf6f3ed51e2c61c0ad2751de4..9652c1de53ec1341bea619be711b41cedc6dde80 100644 (file)
@@ -67,7 +67,8 @@ static inline bool nfsd_attrs_valid(struct nfsd_attrs *attrs)
        struct iattr *iap = attrs->na_iattr;
 
        return (iap->ia_valid || (attrs->na_seclabel &&
-               attrs->na_seclabel->len));
+               attrs->na_seclabel->len) ||
+               attrs->na_pacl || attrs->na_dpacl);
 }
 
 __be32         nfserrno (int errno);