Skip to contentSkip to conversation

NFSD: NFSv4 file creation neglects setting ACL

PATCH In review Chuck Lever 4 participants 20 messages Nov 19, 2025 – Mar 15

Subsystems (2)
lore
Share & tools
lore

Chuck Lever

author maintainer
#0 lore raw

PATCH 1/1 NFSD: NFSv4 file creation neglects setting ACL

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

---
 fs/nfsd/vfs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfsd/vfs.h +2 -1
index fa46f8b5f132..1dd3ae3ceb3a 100644
@@ -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);
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 3 lines

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.

The patch works, now ACLs are working at file creation time for both

|EXCLUSIVE4_1| and |UNCHECKED4| (previously it only worked for
|EXCLUSIVE4_1| but not for |UNCHECKED4|).

----

Bye,
Roland

Signature · 5 lines
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
#2 lore raw
In reply to Chuck Lever
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Yes, it works on all affected clients,platforms (Windows ms-nfs41-client, Windows Exceed NFS4 client, OSX). Thank you.

Windows test code is at
https://github.com/kofemann/ms-nfs41-client/blob/master/tests/atomiccreatefilewithacl/atomiccreatefilewithacl.ps1

The only thing I did not test was exporting a NFSv4+ filesystem with Linux CIFS server, and letting Windows CIFS client create a file with an ACL.

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
#3 lore raw
In reply to Chuck Lever
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
author maintainer
#4 lore raw
Quoted 27 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

Signature · 3 lines
Chuck Lever

[1] git://git.linux-nfs.org/projects/cdmackay/pynfs.git
#5 lore raw
Quoted 29 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 25 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 6 lines
Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

Thank you

My point however was if pynfs can take a list of users@domain, groups@domain as input parameters, which are then used for FATTR4_OWNER, FATTR4_OWNER_GROUP, FATTR4_ACL and FATTR4_DACL tests.

Some of the ACL issues only happen for specific ACL combinations, thus such two lists with parameter input would be useful.

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
author maintainer
#6 lore raw
Quoted 34 lines · Aurélien Couderc
Quoted 33 lines · Chuck Lever
Quoted 30 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

Quoted 8 lines
Quoted 2 lines

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

Thank you

My point however was if pynfs can take a list of users@domain, groups@domain as input parameters, which are then used for FATTR4_OWNER, FATTR4_OWNER_GROUP, FATTR4_ACL and FATTR4_DACL tests.

pynfs tests are not parametrized, but we can choose specific combinations of arguments to exercise, and then add a new test for each of those cases.

Quoted 2 lines

Some of the ACL issues only happen for specific ACL combinations, thus such two lists with parameter input would be useful.

I have additional pynfs tests which aren't quite ready yet that exercise the relationship between OWNER@, GROUP@, and named principals.

There are some complications with the NFSv4 <-> POSIX translation adding a DENY ACE when it doesn't recognize that a named principal is the same as OWNER@ or GROUP@. In that specific case a user can set an ACL that locks the file owner out of the file unintentionally.

Signature · 1 line
Chuck Lever
#7 lore raw
Quoted 43 lines · Chuck Lever
Quoted 39 lines · Aurélien Couderc
Quoted 29 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 25 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 6 lines
Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

Thank you

Quoted 7 lines
Quoted 3 lines

My point however was if pynfs can take a list of users@domain, groups@domain as input parameters, which are then used for FATTR4_OWNER, FATTR4_OWNER_GROUP, FATTR4_ACL and FATTR4_DACL tests.

pynfs tests are not parametrized, but we can choose specific combinations of arguments to exercise, and then add a new test for each of those cases.

OK. But this is a SEVERE and gaping black hole in the test coverage, because it prevents pynfs from properly testing FATTR4_OWNER, FATTR4_OWNER_GROUP, FATTR4_ACL and FATTR4_DACL.

I think there should be parameters like that, and defaults such as pynfsuser1, pynfsuser2, pynfsgroup1 and pynfsgroup2

Quoted 5 lines
Quoted 4 lines

Some of the ACL issues only happen for specific ACL combinations, thus such two lists with parameter input would be useful.

Quoted 8 lines

I have additional pynfs tests which aren't quite ready yet that exercise the relationship between OWNER@, GROUP@, and named principals.

There are some complications with the NFSv4 <-> POSIX translation adding a DENY ACE when it doesn't recognize that a named principal is the same as OWNER@ or GROUP@. In that specific case a user can set an ACL that locks the file owner out of the file unintentionally.

Shouldn't OWNER@, GROUP@ priorise going into the uid and gid fields?

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
#15 lore raw
In reply to Chuck Lever
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

[email protected] is in CC. When will this patch land in the Linux 6.6 and 5.10 STABLE branches?

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
author maintainer
#16 lore raw
Quoted 21 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 8 lines
Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

[email protected] is in CC. When will this patch land in the Linux 6.6 and 5.10 STABLE branches?

I can't give an exact date, but I expect it will appear in the LTS kernels in about 6-7 weeks, unless someone finds an issue with it.

Signature · 1 line
Chuck Lever
#17 lore raw
Quoted 31 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 25 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 5 lines
Quoted 2 lines

[email protected] is in CC. When will this patch land in the Linux 6.6 and 5.10 STABLE branches?

I can't give an exact date, but I expect it will appear in the LTS kernels in about 6-7 weeks, unless someone finds an issue with it.

Do you have a web link (URL) where the patch is in Linus's tree (Linux git HEAD)?

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
author maintainer
#8 lore raw
In reply to Aurélien Couderc
Quoted 48 lines · Aurélien Couderc
Quoted 47 lines · Chuck Lever
Quoted 42 lines · Aurélien Couderc
Quoted 29 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 25 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 6 lines
Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

Thank you

My point however was if pynfs can take a list of users@domain, groups@domain as input parameters, which are then used for FATTR4_OWNER, FATTR4_OWNER_GROUP, FATTR4_ACL and FATTR4_DACL tests.

Quoted 7 lines
Quoted 3 lines

pynfs tests are not parametrized, but we can choose specific combinations of arguments to exercise, and then add a new test for each of those cases.

OK. But this is a SEVERE and gaping black hole in the test coverage, because it prevents pynfs from properly testing FATTR4_OWNER, FATTR4_OWNER_GROUP, FATTR4_ACL and FATTR4_DACL.

Keep in mind that pynfs is a unit test suite meant to exercise /basic/ NFS protocol behavior. Each unit test is typically just as simple as it can be written. [1]

If we want parametrized tests that exercise the more advanced features of ACLs, then IMHO that is not "unit testing", and therefore it lies outside the scope of pynfs.

Generally large deployments build their own test suites that target the specific features they need. There is nothing stopping you from creating a suite of tests specific to NFSv4 ACLs <nudge nudge>.

Above, I see that you have included FATTR4_OWNER and FATTR4_GROUP. What kind of interactions with ACL/DACL are you thinking need to be explored?

Quoted 2 lines

I think there should be parameters like that, and defaults such as pynfsuser1, pynfsuser2, pynfsgroup1 and pynfsgroup2

The new tests I've written (but haven't posted yet) use values very much like your example defaults.

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

Some of the ACL issues only happen for specific ACL combinations, thus such two lists with parameter input would be useful.

I have additional pynfs tests which aren't quite ready yet that exercise the relationship between OWNER@, GROUP@, and named principals.

Quoted 6 lines
Quoted 4 lines

There are some complications with the NFSv4 <-> POSIX translation adding a DENY ACE when it doesn't recognize that a named principal is the same as OWNER@ or GROUP@. In that specific case a user can set an ACL that locks the file owner out of the file unintentionally.

Shouldn't OWNER@, GROUP@ priorise going into the uid and gid fields?

Can you elaborate on that?

Signature · 3 lines
Chuck Lever

[1] https://en.wikipedia.org/wiki/Unit_testing#Unit
author maintainer
#18 lore raw
In reply to Aurélien Couderc
Quoted 32 lines · Aurélien Couderc
Quoted 31 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 25 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

[email protected] is in CC. When will this patch land in the Linux 6.6 and 5.10 STABLE branches?

I can't give an exact date, but I expect it will appear in the LTS kernels in about 6-7 weeks, unless someone finds an issue with it.

Do you have a web link (URL) where the patch is in Linus's tree (Linux git HEAD)?

It hasn't been merged yet, so it isn't in Linus' tree at the moment.

Signature · 1 line
Chuck Lever
#19 lore raw

Is there any target date when this will land in Linux main tree, and when will this land in the Linux 6.6 LTS tree?

Aurélien

Quoted 50 lines · Chuck Lever
Quoted 32 lines · Aurélien Couderc
Quoted 31 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 25 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

[email protected] is in CC. When will this patch land in the Linux 6.6 and 5.10 STABLE branches?

I can't give an exact date, but I expect it will appear in the LTS kernels in about 6-7 weeks, unless someone finds an issue with it.

Do you have a web link (URL) where the patch is in Linus's tree (Linux git HEAD)?

It hasn't been merged yet, so it isn't in Linus' tree at the moment.

--
Chuck Lever

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
#9 lore raw

pynfs tests for set-acl-on-file/dir/dev creation time? Re: [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL

In reply to Chuck Lever
Quoted 33 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

Quoted 7 lines

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

--
Chuck Lever

[1] git://git.linux-nfs.org/projects/cdmackay/pynfs.git

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary was not updated since 10 months. Are the patches stuck, or something else happened

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
#10 lore raw

Re: pynfs tests for set-acl-on-file/dir/dev creation time? Re: [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL

Apologies; I have a number of patches queued up that I need to push out. Will do that asap.

best wishes,
calum.

Quoted 47 lines · Aurélien Couderc
Quoted 33 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

Quoted 7 lines

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

--
Chuck Lever

[1] git://git.linux-nfs.org/projects/cdmackay/pynfs.git

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary was not updated since 10 months. Are the patches stuck, or something else happened

Aurélien

#11 lore raw

Re: pynfs tests for set-acl-on-file/dir/dev creation time? Re: [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary appears to be down at the moment. Could you please post the URL of the commits once the site is up again?

Aurélien

Quoted 57 lines · Calum Mackay

Apologies; I have a number of patches queued up that I need to push out. Will do that asap.

best wishes,
calum.

Quoted 47 lines · Aurélien Couderc
Quoted 33 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

Quoted 7 lines

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

--
Chuck Lever

[1] git://git.linux-nfs.org/projects/cdmackay/pynfs.git

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary was not updated since 10 months. Are the patches stuck, or something else happened

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
#12 lore raw

Re: pynfs tests for set-acl-on-file/dir/dev creation time? Re: [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL

Quoted 3 lines · Aurélien Couderc

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary appears to be down at the moment. Could you please post the URL of the commits once the site is up again?

hi Aurélien,

The site seems to be up at the moment, albeit rather slow to respond.

I don't look after the site itself, so I'm not sure if there are ongoing issues.

best wishes,
calum.

Quoted 63 lines

Aurélien

Quoted 57 lines · Calum Mackay

Apologies; I have a number of patches queued up that I need to push out. Will do that asap.

best wishes,
calum.

Quoted 47 lines · Aurélien Couderc
Quoted 33 lines · Chuck Lever
Quoted 27 lines · Aurélien Couderc
Quoted 20 lines · Chuck Lever

From: Chuck Lever <[email protected]>

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.

Quoted 5 lines
Fixes c0cbe70742f4 ("NFSD: add posix ACLs to struct nfsd_attrs")
Cc Roland Mainz <[email protected]>

X-Cc: [email protected]

Quoted 3 lines

As said the patch works, but are there any tests in the Linux NFS testsuite which cover ACLs with multiple users and groups, at OPEN and SETATTR time?

Quoted 7 lines

I developed several new pynfs [1] tests while troubleshooting this issue. I'll post them soon.

--
Chuck Lever

[1] git://git.linux-nfs.org/projects/cdmackay/pynfs.git

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary was not updated since 10 months. Are the patches stuck, or something else happened

Aurélien

#13 lore raw

Re: pynfs tests for set-acl-on-file/dir/dev creation time? Re: [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL

Quoted 6 lines · Calum Mackay
Quoted 3 lines · Aurélien Couderc

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary appears to be down at the moment. Could you please post the URL of the commits once the site is up again?

Quoted 6 lines

hi Aurélien,

The site seems to be up at the moment, albeit rather slow to respond.

I don't look after the site itself, so I'm not sure if there are ongoing issues.

It works again for me, but there are no new changes for 2026. Did you push your patches?

Aurélien

Signature · 2 lines
Aurélien Couderc <[email protected]>
Big Data/Data mining expert, chess enthusiast
#14 lore raw

Re: pynfs tests for set-acl-on-file/dir/dev creation time? Re: [PATCH v1] NFSD: NFSv4 file creation neglects setting ACL

Quoted 9 lines · Aurélien Couderc
Quoted 8 lines · Calum Mackay
Quoted 3 lines · Aurélien Couderc

https://git.linux-nfs.org/?p=cdmackay/pynfs.git;a=summary appears to be down at the moment. Could you please post the URL of the commits once the site is up again?

hi Aurélien,

Quoted 7 lines
Quoted 4 lines

The site seems to be up at the moment, albeit rather slow to respond.

I don't look after the site itself, so I'm not sure if there are ongoing issues.

It works again for me, but there are no new changes for 2026. Did you push your patches?

Not yet, but I will soon, hopefully this week.

thanks,
calum.