Browse Source

Use the new "kill_proc_info_as_uid()" for USB disconnect too

All the same issues - we can't just save the pointer to the thread, we
must save the pid/uid/euid combination.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Linus Torvalds 19 years ago
parent
commit
d7dd8a72ab
3 changed files with 6 additions and 3 deletions
  1. 3 1
      drivers/usb/core/devio.c
  2. 1 1
      drivers/usb/core/inode.c
  3. 2 1
      drivers/usb/core/usb.h

+ 3 - 1
drivers/usb/core/devio.c

@@ -530,7 +530,9 @@ static int usbdev_open(struct inode *inode, struct file *file)
 	INIT_LIST_HEAD(&ps->async_completed);
 	INIT_LIST_HEAD(&ps->async_completed);
 	init_waitqueue_head(&ps->wait);
 	init_waitqueue_head(&ps->wait);
 	ps->discsignr = 0;
 	ps->discsignr = 0;
-	ps->disctask = current;
+	ps->disc_pid = current->pid;
+	ps->disc_uid = current->uid;
+	ps->disc_euid = current->euid;
 	ps->disccontext = NULL;
 	ps->disccontext = NULL;
 	ps->ifclaimed = 0;
 	ps->ifclaimed = 0;
 	wmb();
 	wmb();

+ 1 - 1
drivers/usb/core/inode.c

@@ -713,7 +713,7 @@ void usbfs_remove_device(struct usb_device *dev)
 			sinfo.si_errno = EPIPE;
 			sinfo.si_errno = EPIPE;
 			sinfo.si_code = SI_ASYNCIO;
 			sinfo.si_code = SI_ASYNCIO;
 			sinfo.si_addr = ds->disccontext;
 			sinfo.si_addr = ds->disccontext;
-			send_sig_info(ds->discsignr, &sinfo, ds->disctask);
+			kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid);
 		}
 		}
 	}
 	}
 	usbfs_update_special();
 	usbfs_update_special();

+ 2 - 1
drivers/usb/core/usb.h

@@ -52,7 +52,8 @@ struct dev_state {
 	struct list_head async_completed;
 	struct list_head async_completed;
 	wait_queue_head_t wait;     /* wake up if a request completed */
 	wait_queue_head_t wait;     /* wake up if a request completed */
 	unsigned int discsignr;
 	unsigned int discsignr;
-	struct task_struct *disctask;
+	pid_t disc_pid;
+	uid_t disc_uid, disc_euid;
 	void __user *disccontext;
 	void __user *disccontext;
 	unsigned long ifclaimed;
 	unsigned long ifclaimed;
 };
 };