mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Su Hui <suhui@nfschina.com>, Jan Harkes <jaharkes@cs.cmu.edu>,
	coda@cs.cmu.edu
Cc: codalist@coda.cs.cmu.edu, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] coda: return -EFAULT if copy fails
Date: Mon, 15 May 2023 19:15:54 +0200	[thread overview]
Message-ID: <5359488e-2b37-b328-3dbc-00bedd1726d5@wanadoo.fr> (raw)
In-Reply-To: <20230515061923.767680-1-suhui@nfschina.com>

Le 15/05/2023 à 08:19, Su Hui a écrit :
> The copy_to/from_user() functions should return -EFAULT instead of -EINVAL.

Hi,

just for my understanding, why?

Even if not perfect:
    git grep -A1 copy_from_user | grep EINV | wc -l
    15

    git grep -A1 copy_to_user | grep EINV | wc -l
    12

CJ

> 
> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
>   fs/coda/upcall.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
> index cd6a3721f6f6..1517dc3bd592 100644
> --- a/fs/coda/upcall.c
> +++ b/fs/coda/upcall.c
> @@ -510,7 +510,7 @@ int venus_pioctl(struct super_block *sb, struct CodaFid *fid,
>           /* get the data out of user space */
>   	if (copy_from_user((char *)inp + (long)inp->coda_ioctl.data,
>   			   data->vi.in, data->vi.in_size)) {
> -		error = -EINVAL;
> +		error = -EFAULT;
>   	        goto exit;
>   	}
>   



  parent reply	other threads:[~2023-05-15 17:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  6:19 Su Hui
2023-05-15  7:35 ` Dan Carpenter
2023-05-16  1:35   ` Su Hui
2023-05-15 17:15 ` Christophe JAILLET [this message]
     [not found] <574ad370-cb3a-76db-ca8f-4203d42cc0fc@nfschina.com>
2023-05-16  1:17 ` Su Hui

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=5359488e-2b37-b328-3dbc-00bedd1726d5@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@coda.cs.cmu.edu \
    --cc=jaharkes@cs.cmu.edu \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suhui@nfschina.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®