[PATCH] exec: add __user case in get_user_arg_ptr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux