diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devio.c | 16 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/usb.h | 3 | ||||
-rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 3 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/generic.c | 2 |
6 files changed, 18 insertions, 11 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index b4265aa7d45e..487ff672b104 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -30,6 +30,8 @@ | |||
30 | * Revision history | 30 | * Revision history |
31 | * 22.12.1999 0.1 Initial release (split from proc_usb.c) | 31 | * 22.12.1999 0.1 Initial release (split from proc_usb.c) |
32 | * 04.01.2000 0.2 Turned into its own filesystem | 32 | * 04.01.2000 0.2 Turned into its own filesystem |
33 | * 30.09.2005 0.3 Fix user-triggerable oops in async URB delivery | ||
34 | * (CAN-2005-3055) | ||
33 | */ | 35 | */ |
34 | 36 | ||
35 | /*****************************************************************************/ | 37 | /*****************************************************************************/ |
@@ -58,7 +60,8 @@ static struct class *usb_device_class; | |||
58 | struct async { | 60 | struct async { |
59 | struct list_head asynclist; | 61 | struct list_head asynclist; |
60 | struct dev_state *ps; | 62 | struct dev_state *ps; |
61 | struct task_struct *task; | 63 | pid_t pid; |
64 | uid_t uid, euid; | ||
62 | unsigned int signr; | 65 | unsigned int signr; |
63 | unsigned int ifnum; | 66 | unsigned int ifnum; |
64 | void __user *userbuffer; | 67 | void __user *userbuffer; |
@@ -290,7 +293,8 @@ static void async_completed(struct urb *urb, struct pt_regs *regs) | |||
290 | sinfo.si_errno = as->urb->status; | 293 | sinfo.si_errno = as->urb->status; |
291 | sinfo.si_code = SI_ASYNCIO; | 294 | sinfo.si_code = SI_ASYNCIO; |
292 | sinfo.si_addr = as->userurb; | 295 | sinfo.si_addr = as->userurb; |
293 | send_sig_info(as->signr, &sinfo, as->task); | 296 | kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid, |
297 | as->euid); | ||
294 | } | 298 | } |
295 | wake_up(&ps->wait); | 299 | wake_up(&ps->wait); |
296 | } | 300 | } |
@@ -526,7 +530,9 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
526 | INIT_LIST_HEAD(&ps->async_completed); | 530 | INIT_LIST_HEAD(&ps->async_completed); |
527 | init_waitqueue_head(&ps->wait); | 531 | init_waitqueue_head(&ps->wait); |
528 | ps->discsignr = 0; | 532 | ps->discsignr = 0; |
529 | ps->disctask = current; | 533 | ps->disc_pid = current->pid; |
534 | ps->disc_uid = current->uid; | ||
535 | ps->disc_euid = current->euid; | ||
530 | ps->disccontext = NULL; | 536 | ps->disccontext = NULL; |
531 | ps->ifclaimed = 0; | 537 | ps->ifclaimed = 0; |
532 | wmb(); | 538 | wmb(); |
@@ -988,7 +994,9 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
988 | as->userbuffer = NULL; | 994 | as->userbuffer = NULL; |
989 | as->signr = uurb->signr; | 995 | as->signr = uurb->signr; |
990 | as->ifnum = ifnum; | 996 | as->ifnum = ifnum; |
991 | as->task = current; | 997 | as->pid = current->pid; |
998 | as->uid = current->uid; | ||
999 | as->euid = current->euid; | ||
992 | if (!(uurb->endpoint & USB_DIR_IN)) { | 1000 | if (!(uurb->endpoint & USB_DIR_IN)) { |
993 | if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { | 1001 | if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { |
994 | free_async(as); | 1002 | free_async(as); |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 640f41e47029..d07bba01995b 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -713,7 +713,7 @@ void usbfs_remove_device(struct usb_device *dev) | |||
713 | sinfo.si_errno = EPIPE; | 713 | sinfo.si_errno = EPIPE; |
714 | sinfo.si_code = SI_ASYNCIO; | 714 | sinfo.si_code = SI_ASYNCIO; |
715 | sinfo.si_addr = ds->disccontext; | 715 | sinfo.si_addr = ds->disccontext; |
716 | send_sig_info(ds->discsignr, &sinfo, ds->disctask); | 716 | kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid); |
717 | } | 717 | } |
718 | } | 718 | } |
719 | usbfs_update_special(); | 719 | usbfs_update_special(); |
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 83d48c8133af..e6504f3370ad 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -52,7 +52,8 @@ struct dev_state { | |||
52 | struct list_head async_completed; | 52 | struct list_head async_completed; |
53 | wait_queue_head_t wait; /* wake up if a request completed */ | 53 | wait_queue_head_t wait; /* wake up if a request completed */ |
54 | unsigned int discsignr; | 54 | unsigned int discsignr; |
55 | struct task_struct *disctask; | 55 | pid_t disc_pid; |
56 | uid_t disc_uid, disc_euid; | ||
56 | void __user *disccontext; | 57 | void __user *disccontext; |
57 | unsigned long ifclaimed; | 58 | unsigned long ifclaimed; |
58 | }; | 59 | }; |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 41bbae83fc71..e142056b0d2c 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -326,7 +326,8 @@ static void postproc_atl_queue(struct isp116x *isp116x) | |||
326 | usb_settoggle(udev, ep->epnum, | 326 | usb_settoggle(udev, ep->epnum, |
327 | ep->nextpid == | 327 | ep->nextpid == |
328 | USB_PID_OUT, | 328 | USB_PID_OUT, |
329 | PTD_GET_TOGGLE(ptd) ^ 1); | 329 | PTD_GET_TOGGLE(ptd)); |
330 | urb->actual_length += PTD_GET_COUNT(ptd); | ||
330 | urb->status = cc_to_error[TD_DATAUNDERRUN]; | 331 | urb->status = cc_to_error[TD_DATAUNDERRUN]; |
331 | spin_unlock(&urb->lock); | 332 | spin_unlock(&urb->lock); |
332 | continue; | 333 | continue; |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index a99865c689c5..41f92b924761 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -1702,10 +1702,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1702 | if ((endpoint->bmAttributes & 3) != 3) /* Not an interrupt endpoint */ | 1702 | if ((endpoint->bmAttributes & 3) != 3) /* Not an interrupt endpoint */ |
1703 | continue; | 1703 | continue; |
1704 | 1704 | ||
1705 | /* handle potential highspeed HID correctly */ | ||
1706 | interval = endpoint->bInterval; | 1705 | interval = endpoint->bInterval; |
1707 | if (dev->speed == USB_SPEED_HIGH) | ||
1708 | interval = 1 << (interval - 1); | ||
1709 | 1706 | ||
1710 | /* Change the polling interval of mice. */ | 1707 | /* Change the polling interval of mice. */ |
1711 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) | 1708 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index ddde5fb13f6b..5f7d3193d355 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -223,7 +223,7 @@ int usb_serial_generic_write_room (struct usb_serial_port *port) | |||
223 | dbg("%s - port %d", __FUNCTION__, port->number); | 223 | dbg("%s - port %d", __FUNCTION__, port->number); |
224 | 224 | ||
225 | if (serial->num_bulk_out) { | 225 | if (serial->num_bulk_out) { |
226 | if (port->write_urb_busy) | 226 | if (!(port->write_urb_busy)) |
227 | room = port->bulk_out_size; | 227 | room = port->bulk_out_size; |
228 | } | 228 | } |
229 | 229 | ||