Skip to content

nfs_common: Encode an ACL with fewer than three entries as empty

Chuck Lever linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2nfs_common: Do not encode an ACL with fewer than three entriesfs/nfs_common/nfsacl.c include/linux/nfsacl.h+5 -31 reply
2/2nfs_common: Do not stream-encode an ACL with fewer than three entriesfs/nfs_common/nfsacl.c+2 -10 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAnna Schumaker
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v1 0/2] nfs_common: Encode an ACL with fewer than three entries as empty

Both ACL encoders in fs/nfs_common report at least four wire entries for any ACL that has entries, then walk a_entries[] up to that count. An ACL with one or two entries sends the walk past the end of the posix_acl allocation.

nfsacl_encode() builds only the NFS client's SETACL arguments, and nfs_stream_encode_acl() builds only NFSD's GETACL replies. The fixes are separate patches because a combined one does not apply to the stable trees that predate nfs_stream_encode_acl().

The NFS client still caches a GETACL result without validating it. This series does not change that.

Neither over-read has been observed at runtime. Both paths were traced from the code, and the patches are build-tested only.

Patch 1 changes what the NFS client sends in SETACL, so it needs an Acked-by from the NFS client maintainers before it goes through the nfsd tree.

Chuck Lever (2):
nfs_common: Do not encode an ACL with fewer than three entries
nfs_common: Do not stream-encode an ACL with fewer than three entries

 fs/nfs_common/nfsacl.c | 6 ++++--
 include/linux/nfsacl.h | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
Signature · 1 line
2.55.0