linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL
@ 2025-11-19  0:51 Chuck Lever
  2025-11-20 18:31 ` Roland Mainz
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Chuck Lever @ 2025-11-19  0:51 UTC (permalink / raw)
  To: NeilBrown, Jeff Layton, Olga Kornievskaia, Dai Ngo, Tom Talpey
  Cc: linux-nfs, Chuck Lever, Aurélien Couderc, Roland Mainz

From: Chuck Lever <chuck.lever@oracle.com>

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>
X-Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
---
 fs/nfsd/vfs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
index fa46f8b5f132..1dd3ae3ceb3a 100644
--- a/fs/nfsd/vfs.h
+++ b/fs/nfsd/vfs.h
@@ -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);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-12-18  7:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19  0:51 [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL Chuck Lever
2025-11-20 18:31 ` Roland Mainz
2025-11-20 21:22 ` Aurélien Couderc
2025-11-23 14:54 ` Aurélien Couderc
2025-11-23 15:46   ` Chuck Lever
2025-11-27 21:12     ` Aurélien Couderc
2025-11-28 15:44       ` Chuck Lever
2025-11-29  7:55         ` Aurélien Couderc
2025-11-29 16:09           ` Chuck Lever
2025-11-29  7:57 ` Aurélien Couderc
2025-11-29 15:40   ` Chuck Lever
2025-11-29 15:49     ` Aurélien Couderc
2025-11-29 16:16       ` Chuck Lever
2025-12-18  7:46         ` Aurélien Couderc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).