* [PATCH] exec: add __user case in get_user_arg_ptr()
@ 2019-03-01 13:01 Ben Dooks
0 siblings, 0 replies; only message in thread
From: Ben Dooks @ 2019-03-01 13:01 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel; +Cc: Alexander Viro, linux-kernel, Ben Dooks
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-03-01 13:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-01 13:01 [PATCH] exec: add __user case in get_user_arg_ptr() Ben Dooks
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).