Skip to content

Commit 2f65d43

Browse files
committed
NFSD: Finish converting the NFSv2 GETACL result encoder
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Chuck Lever <chuck.lever@oracle.com> commit ea5021e The xdr_stream conversion inadvertently left some code that set the page_len of the send buffer. The XDR stream encoders should handle this automatically now. This oversight adds garbage past the end of the Reply message. Clients typically ignore the garbage, but NFSD does not need to send it, as it leaks stale memory contents onto the wire. Fixes: f8cba47 ("NFSD: Update the NFSv2 GETACL result encoder to use struct xdr_stream") Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> (cherry picked from commit ea5021e) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 16d02b5 commit 2f65d43

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

fs/nfsd/nfs2acl.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
246246
struct nfsd3_getaclres *resp = rqstp->rq_resp;
247247
struct dentry *dentry = resp->fh.fh_dentry;
248248
struct inode *inode;
249-
int w;
250249

251250
if (!svcxdr_encode_stat(xdr, resp->status))
252251
return false;
@@ -260,15 +259,6 @@ nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, struct xdr_stream *xdr)
260259
if (xdr_stream_encode_u32(xdr, resp->mask) < 0)
261260
return false;
262261

263-
rqstp->rq_res.page_len = w = nfsacl_size(
264-
(resp->mask & NFS_ACL) ? resp->acl_access : NULL,
265-
(resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
266-
while (w > 0) {
267-
if (!*(rqstp->rq_next_page++))
268-
return true;
269-
w -= PAGE_SIZE;
270-
}
271-
272262
if (!nfs_stream_encode_acl(xdr, inode, resp->acl_access,
273263
resp->mask & NFS_ACL, 0))
274264
return false;

0 commit comments

Comments
 (0)