Skip to content

Commit ff84778

Browse files
author
Al Viro
committed
pstore: switch to copy_from_user()
don't bother trying to do bulk access_ok() Signed-off-by: Al Viro <[email protected]>
1 parent daa9883 commit ff84778

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/pstore/ram_core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static int notrace persistent_ram_update_user(struct persistent_ram_zone *prz,
283283
const void __user *s, unsigned int start, unsigned int count)
284284
{
285285
struct persistent_ram_buffer *buffer = prz->buffer;
286-
int ret = unlikely(__copy_from_user(buffer->data + start, s, count)) ?
286+
int ret = unlikely(copy_from_user(buffer->data + start, s, count)) ?
287287
-EFAULT : 0;
288288
persistent_ram_update_ecc(prz, start, count);
289289
return ret;
@@ -348,8 +348,6 @@ int notrace persistent_ram_write_user(struct persistent_ram_zone *prz,
348348
int rem, ret = 0, c = count;
349349
size_t start;
350350

351-
if (unlikely(!access_ok(s, count)))
352-
return -EFAULT;
353351
if (unlikely(c > prz->buffer_size)) {
354352
s += c - prz->buffer_size;
355353
c = prz->buffer_size;

0 commit comments

Comments
 (0)