Skip to content

Commit e739b12

Browse files
olgakorn1chucklever
authored andcommitted
NFSv4.2: fix copy stateid copying for the async copy
This patch fixes Dan Carpenter's report that the static checker found a problem where memcpy() was copying into too small of a buffer. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: e0639dc ("NFSD introduce async copy feature") Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Dai Ngo <dai.ngo@oracle.com>
1 parent c0a744d commit e739b12

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/nfsd/nfs4proc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
15411541
if (!nfs4_init_copy_state(nn, copy))
15421542
goto out_err;
15431543
refcount_set(&async_copy->refcount, 1);
1544-
memcpy(&copy->cp_res.cb_stateid, &copy->cp_stateid,
1545-
sizeof(copy->cp_stateid));
1544+
memcpy(&copy->cp_res.cb_stateid, &copy->cp_stateid.stid,
1545+
sizeof(copy->cp_res.cb_stateid));
15461546
dup_copy_fields(copy, async_copy);
15471547
async_copy->copy_task = kthread_create(nfsd4_do_async_copy,
15481548
async_copy, "%s", "copy thread");

0 commit comments

Comments
 (0)