Skip to contentSkip to conversation

fs/compat_rw_copy_check_uvector: add missing compat_ptr call

PATCH In review Heiko Carstens 2 participants 2 messages May 28, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/compat_rw_copy_check_uvector: add missing compat_ptr call

From: Heiko Carstens <[email protected]>

A call to access_ok is missing a compat_ptr conversion. Introduced with b83733639a494d5f42fa00a2506563fbd2d3015d "compat: factor out compat_rw_copy_check_uvector from compat_do_readv_writev"

fs/compat.c: In function 'compat_rw_copy_check_uvector':
fs/compat.c:629: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast

---

Probably should go into stable like the original patch.

 fs/compat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/compat.c +1 -1
@@ -626,7 +626,7 @@ ssize_t compat_rw_copy_check_uvector(int
 		tot_len += len;
 		if (tot_len < tmp) /* maths overflow on the compat_ssize_t */
 			goto out;
-		if (!access_ok(vrfy_dir(type), buf, len)) {
+		if (!access_ok(vrfy_dir(type), compat_ptr(buf), len)) {
 			ret = -EFAULT;
 			goto out;
 		}
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

A call to access_ok is missing a compat_ptr conversion. Introduced with b83733639a494d5f42fa00a2506563fbd2d3015d "compat: factor out compat_rw_copy_check_uvector from compat_do_readv_writev"

fs/compat.c: In function 'compat_rw_copy_check_uvector':
fs/compat.c:629: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast

Thanks for catching this. I'm ashamed I missed the compiler warning. :(