Re: [PATCH 09/10] nfsd: cap decoded POSIX ACL count to bound sort cost

"Chuck Lever" <[email protected]>
Newsgroups gmane.linux.nfs,gmane.linux.kernel
Message-ID <[email protected]>
[ replaced broken email address for Trond ]

On Thu, May 28, 2026, at 5:55 PM, Jeff Layton wrote:

> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index c6c50c376b23..5469c6c207ba 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -448,6 +448,8 @@ nfsd4_decode_posixacl(struct nfsd4_compoundargs 
> *argp, struct posix_acl **acl)
> 
>  	if (xdr_stream_decode_u32(argp->xdr, &count) < 0)
>  		return nfserr_bad_xdr;
> +	if (count > NFS_ACL_MAX_ENTRIES)
> +		return nfserr_resource;

nfserr_resource is consistent with other fattr4 decoders, but
does not make sense here, IMO. A better choice is nfserr_inval.

Rick, any opinion?


>  	*acl = posix_acl_alloc(count, GFP_KERNEL);
>  	if (*acl == NULL)
>
> -- 
> 2.54.0

-- 
Chuck Lever
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.