pstore: switch to copy_from_user()
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 18 Feb 2020 20:43:52 +0000 (15:43 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 23 Apr 2020 14:52:48 +0000 (10:52 -0400)
don't bother trying to do bulk access_ok()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/pstore/ram_core.c

index c917c191e78c6860d0ba08d208618499178b1eb1..aa8e0b65ff1ae07d67e19bba51a3b5e872e006db 100644 (file)
@@ -283,7 +283,7 @@ static int notrace persistent_ram_update_user(struct persistent_ram_zone *prz,
        const void __user *s, unsigned int start, unsigned int count)
 {
        struct persistent_ram_buffer *buffer = prz->buffer;
-       int ret = unlikely(__copy_from_user(buffer->data + start, s, count)) ?
+       int ret = unlikely(copy_from_user(buffer->data + start, s, count)) ?
                -EFAULT : 0;
        persistent_ram_update_ecc(prz, start, count);
        return ret;
@@ -348,8 +348,6 @@ int notrace persistent_ram_write_user(struct persistent_ram_zone *prz,
        int rem, ret = 0, c = count;
        size_t start;
 
-       if (unlikely(!access_ok(s, count)))
-               return -EFAULT;
        if (unlikely(c > prz->buffer_size)) {
                s += c - prz->buffer_size;
                c = prz->buffer_size;