aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
committerJames Morris <jmorris@namei.org>2008-12-24 19:40:09 -0500
commitcbacc2c7f066a1e01b33b0e27ae5efbf534bc2db (patch)
tree90d1093131d2a3543a8b3b1f3364e7c6f4081a93 /drivers/usb/core
parent4a6908a3a050aacc9c3a2f36b276b46c0629ad91 (diff)
parent74192246910ff4fb95309ba1a683215644beeb62 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/devio.c10
-rw-r--r--drivers/usb/core/inode.c4
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 2bccefebff1b..aa79280df15d 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -574,6 +574,7 @@ static int usbdev_open(struct inode *inode, struct file *file)
574{ 574{
575 struct usb_device *dev = NULL; 575 struct usb_device *dev = NULL;
576 struct dev_state *ps; 576 struct dev_state *ps;
577 const struct cred *cred = current_cred();
577 int ret; 578 int ret;
578 579
579 lock_kernel(); 580 lock_kernel();
@@ -617,8 +618,8 @@ static int usbdev_open(struct inode *inode, struct file *file)
617 init_waitqueue_head(&ps->wait); 618 init_waitqueue_head(&ps->wait);
618 ps->discsignr = 0; 619 ps->discsignr = 0;
619 ps->disc_pid = get_pid(task_pid(current)); 620 ps->disc_pid = get_pid(task_pid(current));
620 ps->disc_uid = current->uid; 621 ps->disc_uid = cred->uid;
621 ps->disc_euid = current->euid; 622 ps->disc_euid = cred->euid;
622 ps->disccontext = NULL; 623 ps->disccontext = NULL;
623 ps->ifclaimed = 0; 624 ps->ifclaimed = 0;
624 security_task_getsecid(current, &ps->secid); 625 security_task_getsecid(current, &ps->secid);
@@ -967,6 +968,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
967 struct usb_host_endpoint *ep; 968 struct usb_host_endpoint *ep;
968 struct async *as; 969 struct async *as;
969 struct usb_ctrlrequest *dr = NULL; 970 struct usb_ctrlrequest *dr = NULL;
971 const struct cred *cred = current_cred();
970 unsigned int u, totlen, isofrmlen; 972 unsigned int u, totlen, isofrmlen;
971 int ret, ifnum = -1; 973 int ret, ifnum = -1;
972 int is_in; 974 int is_in;
@@ -1174,8 +1176,8 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1174 as->signr = uurb->signr; 1176 as->signr = uurb->signr;
1175 as->ifnum = ifnum; 1177 as->ifnum = ifnum;
1176 as->pid = get_pid(task_pid(current)); 1178 as->pid = get_pid(task_pid(current));
1177 as->uid = current->uid; 1179 as->uid = cred->uid;
1178 as->euid = current->euid; 1180 as->euid = cred->euid;
1179 security_task_getsecid(current, &as->secid); 1181 security_task_getsecid(current, &as->secid);
1180 if (!is_in) { 1182 if (!is_in) {
1181 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, 1183 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer,
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 94632264dccf..185be760833e 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -277,8 +277,8 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de
277 277
278 if (inode) { 278 if (inode) {
279 inode->i_mode = mode; 279 inode->i_mode = mode;
280 inode->i_uid = current->fsuid; 280 inode->i_uid = current_fsuid();
281 inode->i_gid = current->fsgid; 281 inode->i_gid = current_fsgid();
282 inode->i_blocks = 0; 282 inode->i_blocks = 0;
283 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 283 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
284 switch (mode & S_IFMT) { 284 switch (mode & S_IFMT) {