exec: add __user case in get_user_arg_ptr()
Subsystems (2)
PATCH 1/1 exec: add __user case in get_user_arg_ptr()
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 <[email protected]>
--- fs/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/exec.c +2 -2
@@ -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; }
Signature · 1 line
2.20.1