Skip to content

Commit

Permalink
Merge branch 'uaccess.__copy_from_user' of git://git.kernel.org/pub/s…
Browse files Browse the repository at this point in the history
…cm/linux/kernel/git/viro/vfs

Pull uaccess/__copy_from_user updates from Al Viro:
 "Getting rid of __copy_from_user() callers - patches that don't fit
  into other series"

* 'uaccess.__copy_from_user' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  pstore: switch to copy_from_user()
  firewire: switch ioctl_queue_iso to use of copy_from_user()
  • Loading branch information
torvalds committed Jun 1, 2020
2 parents 4fdea58 + ff84778 commit 56446ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,6 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg)
return -EINVAL;

p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(a->packets);
if (!access_ok(p, a->size))
return -EFAULT;

end = (void __user *)p + a->size;
count = 0;
Expand Down Expand Up @@ -1120,7 +1118,7 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg)
&p->header[transmit_header_bytes / 4];
if (next > end)
return -EINVAL;
if (__copy_from_user
if (copy_from_user
(u.packet.header, p->header, transmit_header_bytes))
return -EFAULT;
if (u.packet.skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT &&
Expand Down
4 changes: 1 addition & 3 deletions fs/pstore/ram_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 56446ef

Please sign in to comment.