Re: [PATCH 1/1] NFSv4.2: fix copy stateid copying for the async copy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Olga-

> On Mar 30, 2021, at 3:03 PM, Olga Kornievskaia <olga.kornievskaia@xxxxxxxxx> wrote:
> 
> From: Olga Kornievskaia <kolga@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> Fixes: e0639dc5805a: "NFSD introduce async copy feature"
> Signed-off-by: Olga Kornievskaia <kolga@xxxxxxxxxx>

Thanks! Pushed to the for-next topic branch in:

git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git

With a Reviewed-by: from Dai.


> ---
> fs/nfsd/nfs4proc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index dd9f38d072dd..e13c4c81fb89 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1538,8 +1538,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> 		if (!nfs4_init_copy_state(nn, copy))
> 			goto out_err;
> 		refcount_set(&async_copy->refcount, 1);
> -		memcpy(&copy->cp_res.cb_stateid, &copy->cp_stateid,
> -			sizeof(copy->cp_stateid));
> +		memcpy(&copy->cp_res.cb_stateid, &copy->cp_stateid.stid,
> +			sizeof(copy->cp_res.cb_stateid));
> 		dup_copy_fields(copy, async_copy);
> 		async_copy->copy_task = kthread_create(nfsd4_do_async_copy,
> 				async_copy, "%s", "copy thread");
> -- 
> 2.18.2
> 

--
Chuck Lever







[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux