s390/uaccess: remove copy_from_user_real()
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 24 Feb 2014 15:18:55 +0000 (16:18 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 24 Feb 2014 16:14:00 +0000 (17:14 +0100)
There is no user left, so remove it.
It was also potentially broken, since the function didn't clear destination
memory if copy_from_user() failed. Which would allow for information leaks.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/uaccess.h
arch/s390/mm/maccess.c

index 2710b41eed22af461dac06ddf80af77b3fcfe4d8..4133b3f72fb09a04c9f640cd214ef4a21a69c9db 100644 (file)
@@ -344,6 +344,5 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo
 }
 
 int copy_to_user_real(void __user *dest, void *src, unsigned long count);
-int copy_from_user_real(void *dest, void __user *src, unsigned long count);
 
 #endif /* __S390_UACCESS_H */
index efe8ad045c7b7e358be7fa5fa7822751ef3a99ca..2a2e35416d2fe7fc4a835795f5c64bca444f1de4 100644 (file)
@@ -151,32 +151,6 @@ out:
        return rc;
 }
 
-/*
- * Copy memory from user (virtual) to kernel (real)
- */
-int copy_from_user_real(void *dest, void __user *src, unsigned long count)
-{
-       int offs = 0, size, rc;
-       char *buf;
-
-       buf = (char *) __get_free_page(GFP_KERNEL);
-       if (!buf)
-               return -ENOMEM;
-       rc = -EFAULT;
-       while (offs < count) {
-               size = min(PAGE_SIZE, count - offs);
-               if (copy_from_user(buf, src + offs, size))
-                       goto out;
-               if (memcpy_real(dest + offs, buf, size))
-                       goto out;
-               offs += size;
-       }
-       rc = 0;
-out:
-       free_page((unsigned long) buf);
-       return rc;
-}
-
 /*
  * Check if physical address is within prefix or zero page
  */