From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.or
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-kernel@lists.codethink.co.uk,
Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH] exec: add __user case in get_user_arg_ptr()
Date: Fri, 1 Mar 2019 13:01:06 +0000 [thread overview]
Message-ID: <20190301130106.4121-1-ben.dooks@codethink.co.uk> (raw)
The get_user_arg_ptr() returns a __user annotated pointer
but the ERR_PTR() returns do not have this annotation which
triggers sparse warnings. Add a case to (char __user *) to
fix the following:
fs/exec.c:409:39: warning: incorrect type in return expression (different address spaces)
fs/exec.c:409:39: expected char const [noderef] <asn:1>*
fs/exec.c:409:39: got void *
fs/exec.c:416:31: warning: incorrect type in return expression (different address spaces)
fs/exec.c:416:31: expected char const [noderef] <asn:1>*
fs/exec.c:416:31: got void *
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
fs/exec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index fb72d36f7823..19fa6f082db9 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -406,14 +406,14 @@ static const char __user *get_user_arg_ptr(struct user_arg_ptr argv, int nr)
compat_uptr_t compat;
if (get_user(compat, argv.ptr.compat + nr))
- return ERR_PTR(-EFAULT);
+ return (char __user *)ERR_PTR(-EFAULT);
return compat_ptr(compat);
}
#endif
if (get_user(native, argv.ptr.native + nr))
- return ERR_PTR(-EFAULT);
+ return (char __user *)ERR_PTR(-EFAULT);
return native;
}
--
2.20.1
reply other threads:[~2019-03-01 13:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190301130106.4121-1-ben.dooks@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-kernel@vger.kernel.or \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).