From: Su Hui <suhui@nfschina.com>
To: 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, Su Hui <suhui@nfschina.com>
Subject: [PATCH] coda: return -EFAULT if copy fails
Date: Mon, 15 May 2023 14:19:23 +0800 [thread overview]
Message-ID: <20230515061923.767680-1-suhui@nfschina.com> (raw)
The copy_to/from_user() functions should return -EFAULT instead of -EINVAL.
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;
}
--
2.30.2
next reply other threads:[~2023-05-15 6:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 6:19 Su Hui [this message]
2023-05-15 7:35 ` Dan Carpenter
2023-05-16 1:35 ` Su Hui
2023-05-15 17:15 ` Christophe JAILLET
[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=20230515061923.767680-1-suhui@nfschina.com \
--to=suhui@nfschina.com \
--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 \
/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®