Skip to content

Commit

Permalink
Revert "[PATCH] usb: drivers/usb/core/devio.c dereferences a userspac…
Browse files Browse the repository at this point in the history
…e pointer"

This reverts commit 786dc1d.

As Al so eloquently points out, the patch is crap. The old code was fine,
the new code was bogus.

It never dereferenced a user pointer, the "->" operator was to an array
member, which gives the _address_ of the member (in user space), not an
actual dereference at all.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Linus Torvalds committed Jun 25, 2006
1 parent abb1cf3 commit 83626b0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,9 +1078,7 @@ static int proc_submiturb(struct dev_state *ps, void __user *arg)
if (copy_from_user(&uurb, arg, sizeof(uurb)))
return -EFAULT;

return proc_do_submiturb(ps, &uurb,
(struct usbdevfs_iso_packet_desc __user *)uurb.iso_frame_desc,
arg);
return proc_do_submiturb(ps, &uurb, (((struct usbdevfs_urb __user *)arg)->iso_frame_desc), arg);
}

static int proc_unlinkurb(struct dev_state *ps, void __user *arg)
Expand Down Expand Up @@ -1205,9 +1203,7 @@ static int proc_submiturb_compat(struct dev_state *ps, void __user *arg)
if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg))
return -EFAULT;

return proc_do_submiturb(ps, &uurb,
(struct usbdevfs_iso_packet_desc __user *)uurb.iso_frame_desc,
arg);
return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg);
}

static int processcompl_compat(struct async *as, void __user * __user *arg)
Expand Down

0 comments on commit 83626b0

Please sign in to comment.