From: Chuck Lever III <chuck.lever@oracle.com>
To: Olga Kornievskaia <olga.kornievskaia@gmail.com>
Cc: Bruce Fields <bfields@redhat.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] NFSv4.2: fix copy stateid copying for the async copy
Date: Wed, 31 Mar 2021 16:39:30 +0000 [thread overview]
Message-ID: <AAB69ABA-6AD8-4623-A823-B1B3FF8BA1FB@oracle.com> (raw)
In-Reply-To: <20210330190359.13057-1-olga.kornievskaia@gmail.com>
Hi Olga-
> On Mar 30, 2021, at 3:03 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
>
> From: Olga Kornievskaia <kolga@netapp.com>
>
> 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: e0639dc5805a: "NFSD introduce async copy feature"
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
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(©->cp_res.cb_stateid, ©->cp_stateid,
> - sizeof(copy->cp_stateid));
> + memcpy(©->cp_res.cb_stateid, ©->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
next prev parent reply other threads:[~2021-03-31 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 19:03 [PATCH 1/1] NFSv4.2: fix copy stateid copying for the async copy Olga Kornievskaia
2021-03-31 16:39 ` Chuck Lever III [this message]
2021-03-31 20:54 ` Olga Kornievskaia
2021-04-01 13:35 ` Chuck Lever III
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AAB69ABA-6AD8-4623-A823-B1B3FF8BA1FB@oracle.com \
--to=chuck.lever@oracle.com \
--cc=bfields@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=olga.kornievskaia@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.