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

Jeff Layton <[email protected]>
Newsgroups gmane.linux.nfs,gmane.linux.kernel
Message-ID <[email protected]>
On Fri, 2026-05-29 at 14:34 -0400, Chuck Lever wrote:
> [ 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.
> 

Why not? An ACL that long doesn't violate the spec (as you pointed
out), the implementation just can't handle it. I do agree that
nfserr_resource is not the ideal error code, but it's the closest error
I can see that says "you hit an internal limitation of the server".

> Rick, any opinion?
> 
> 
> >  	*acl = posix_acl_alloc(count, GFP_KERNEL);
> >  	if (*acl == NULL)
> > 
> > -- 
> > 2.54.0

-- 
Jeff Layton <[email protected]>
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.