Conversation
DACL was encoded in a post-loop block that ran after the bitmap- iteration encoder had emitted higher-numbered attributes. When a client requested DACL together with any attribute numbered > 58 (e.g. FATTR4_XATTR_SUPPORT = 82), the DACL bytes landed after the higher-numbered attribute on the wire, violating RFC 8881 §3.3.7's attribute-number ordering and causing clients to decode garbage at the DACL slot. Add nfsd4_encode_fattr4_dacl(), register it at FATTR4_DACL in nfsd4_enc_fattr4_encode_ops[], and move the dacl pointer onto struct nfsd4_fattr_args so it flows through the dispatch path. Also gate the DACL fetch in nfsd4_encode_fattr4() on IS_NFSV4ACL so GETATTR/READDIR matches what supported_attrs advertises and what the SETATTR check in nfs4proc.c enforces; otherwise a client ignoring supported_attrs receives a flag=0 POSIX-translated fake DACL. This bug was discovered by customer using non-Linux NFSv4 client. (cherry picked from commit b92a9de)
Add note for future developers to not break our encoding here. (cherry picked from commit b1f0edc)
Author
anodos325
approved these changes
May 8, 2026
anodos325
approved these changes
May 8, 2026
Author
|
This PR has been merged and conversations have been locked. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DACL was encoded in a post-loop block that ran after the bitmap- iteration encoder had emitted higher-numbered attributes. When a client requested DACL together with any attribute numbered > 58 (e.g. FATTR4_XATTR_SUPPORT = 82), the DACL bytes landed after the higher-numbered attribute on the wire, violating RFC 8881 §3.3.7's attribute-number ordering and causing clients to decode garbage at the DACL slot.
Add nfsd4_encode_fattr4_dacl(), register it at FATTR4_DACL in nfsd4_enc_fattr4_encode_ops[], and move the dacl pointer onto struct nfsd4_fattr_args so it flows through the dispatch path.
Also gate the DACL fetch in nfsd4_encode_fattr4() on IS_NFSV4ACL so GETATTR/READDIR matches what supported_attrs advertises and what the SETATTR check in nfs4proc.c enforces; otherwise a client ignoring supported_attrs receives a flag=0 POSIX-translated fake DACL.
This bug was discovered by customer using non-Linux NFSv4 client.
Original PR: #264