Skip to contentSkip to conversation

nfs_common: release the decoded ACL when an entry is invalid

PATCH In review Wentao Liang 2 participants 2 messages Nov 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs_common: release the decoded ACL when an entry is invalid

xdr_nfsace_decode() allocates the posix_acl lazily from the first ACE and stores it in the decode descriptor. A later entry can still be rejected, for example on an unknown tag, extra permission bits, or an invalid uid/gid. xdr_decode_array2() then returns the error to nfsacl_decode() and nfs_stream_decode_acl(), and both return without releasing the partially decoded ACL.

Release the descriptor's ACL on the decode error path in both callers.

Fixes a257cdd0e217 ("[PATCH] NFSD: Add server support for NFSv3 ACLs.")
Assisted-by DeepSeek-V4.1-Flash and OpenAI Codex
---
 fs/nfs_common/nfsacl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
fs/nfs_common/nfsacl.c +6 -2
index e2eaac14fd8e..c02f0237940f 100644
@@ -353,8 +353,10 @@ int nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt,
 		return -EINVAL;
 	nfsacl_desc.desc.array_maxlen = entries;
 	err = xdr_decode_array2(buf, base + 4, &nfsacl_desc.desc);
-	if (err)
+	if (err) {
+		posix_acl_release(nfsacl_desc.acl);
 		return err;
+	}
 	if (pacl) {
 		if (entries != nfsacl_desc.desc.array_len ||
 		    posix_acl_from_nfsacl(nfsacl_desc.acl) != 0) {
@@ -405,8 +407,10 @@ bool nfs_stream_decode_acl(struct xdr_stream *xdr, unsigned int *aclcnt,
 	if (!xdr_inline_decode(xdr, XDR_UNIT + elem_size * entries))
 		return false;
 	nfsacl_desc.desc.array_maxlen = entries;
-	if (xdr_decode_array2(xdr->buf, base, &nfsacl_desc.desc))
+	if (xdr_decode_array2(xdr->buf, base, &nfsacl_desc.desc)) {
+		posix_acl_release(nfsacl_desc.acl);
 		return false;
+	}
 
 	if (pacl) {
 		if (entries != nfsacl_desc.desc.array_len ||
Signature · 1 line
2.34.1
#1 lore raw
Quoted 9 lines · Wentao Liang

xdr_nfsace_decode() allocates the posix_acl lazily from the first ACE and stores it in the decode descriptor. A later entry can still be rejected, for example on an unknown tag, extra permission bits, or an invalid uid/gid. xdr_decode_array2() then returns the error to nfsacl_decode() and nfs_stream_decode_acl(), and both return without releasing the partially decoded ACL.

Release the descriptor's ACL on the decode error path in both callers.

Quoted 8 lines
Fixes a257cdd0e217 ("[PATCH] NFSD: Add server support for NFSv3 ACLs.")
Assisted-by DeepSeek-V4.1-Flash and OpenAI Codex
---
 fs/nfs_common/nfsacl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.

2. You use multiple identities with this email address, thus I doubt that we speak with an actual person.

3. Your bot does not even bother running checkpatch, right?

4. Nothing of this was reproduced nor tested.

5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent subsystems. The amount of these patches clearly suggest this was AI generated and most likely not tested.

More importantly, you sent all this work without properly organizing relevant patches into patchsets. This makes reviewing difficult and might cause multiple reviewers to address the same issue. Replying to the entire set is impossible and requires handling each patch independently, instead of applying or discarding the set. Maintainers also won't see the bigger picture of your work. Quite worrying.

This is on the verge of hostile patch: bomb us with so many contributions, we won't be able to handle them in efficient manner, like responding ONCE to ask you to slow down. Considering all this is untested and LLM generated, I have even more doubts whether this should be considered for review.

Please read kernel documentation BEFORE posting more work. It will explain you how to identify subsystems, how to organize your work per subsystem (so a patchset grouping multiple patches with a short cover letter), how to document the issue discovery method and what was or was not tested.

Best regards,
Krzysztof