Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932361AbWBFUGT (ORCPT ); Mon, 6 Feb 2006 15:06:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932360AbWBFUGT (ORCPT ); Mon, 6 Feb 2006 15:06:19 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:42112 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S932361AbWBFUGR (ORCPT ); Mon, 6 Feb 2006 15:06:17 -0500 To: Cc: , Herbert Poetzl , "Serge E. Hallyn" , Alan Cox , Dave Hansen , Arjan van de Ven , Suleiman Souhlal , Hubertus Franke , Cedric Le Goater , Kyle Moffett , Kirill Korotaev , Greg , Linus Torvalds , Andrew Morton , Greg KH , Rik van Riel , Alexey Kuznetsov , Andrey Savochkin , Kirill Korotaev , Andi Kleen , Benjamin Herrenschmidt , Jeff Garzik , Trond Myklebust , Jes Sorensen Subject: [RFC][PATCH 17/20] usb: Fixup usb so it works with pspaces. References: From: ebiederm@xmission.com (Eric W. Biederman) Date: Mon, 06 Feb 2006 13:03:57 -0700 In-Reply-To: (Eric W. Biederman's message of "Mon, 06 Feb 2006 13:02:09 -0700") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3532 Lines: 112 Signed-off-by: Eric W. Biederman --- drivers/usb/core/devio.c | 12 ++++++++++-- drivers/usb/core/inode.c | 4 +++- drivers/usb/core/usb.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) 94873f6924179bc2ee782f6fb72d5e855c780a1b diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 2b68998..7bccb9a 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,7 @@ static struct class *usb_device_class; struct async { struct list_head asynclist; struct dev_state *ps; + struct pspace *pspace; pid_t pid; uid_t uid, euid; unsigned int signr; @@ -224,6 +226,7 @@ static struct async *alloc_async(unsigne static void free_async(struct async *as) { + put_pspace(as->pspace); kfree(as->urb->transfer_buffer); kfree(as->urb->setup_packet); usb_free_urb(as->urb); @@ -316,8 +319,8 @@ static void async_completed(struct urb * sinfo.si_errno = as->urb->status; sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = as->userurb; - kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid, - as->euid); + kill_proc_info_as_uid(as->signr, &sinfo, as->pspace, as->pid, + as->uid, as->euid); } snoop(&urb->dev->dev, "urb complete\n"); snoop_urb(urb, as->userurb); @@ -571,6 +574,8 @@ static int usbdev_open(struct inode *ino INIT_LIST_HEAD(&ps->async_completed); init_waitqueue_head(&ps->wait); ps->discsignr = 0; + ps->disc_pspace = current->pspace; + get_pspace(ps->disc_pspace); ps->disc_pid = current->pid; ps->disc_uid = current->uid; ps->disc_euid = current->euid; @@ -601,6 +606,7 @@ static int usbdev_release(struct inode * destroy_all_async(ps); usb_unlock_device(dev); usb_put_dev(dev); + put_pspace(ps->disc_pspace); ps->dev = NULL; kfree(ps); return 0; @@ -1054,6 +1060,8 @@ static int proc_do_submiturb(struct dev_ as->userbuffer = NULL; as->signr = uurb->signr; as->ifnum = ifnum; + as->pspace = current->pspace; + get_pspace(as->pspace); as->pid = current->pid; as->uid = current->uid; as->euid = current->euid; diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 3cf945c..94c91b3 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c @@ -700,7 +700,9 @@ static void usbfs_remove_device(struct u sinfo.si_errno = EPIPE; sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = ds->disccontext; - kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid); + kill_proc_info_as_uid(ds->discsignr, &sinfo, + ds->disc_pspace, ds->disc_pid, + ds->disc_uid, ds->disc_euid); } } } diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 4647e1e..512c5c7 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -73,6 +73,7 @@ struct dev_state { struct list_head async_completed; wait_queue_head_t wait; /* wake up if a request completed */ unsigned int discsignr; + struct pspace *disc_pspace; pid_t disc_pid; uid_t disc_uid, disc_euid; void __user *disccontext; -- 1.1.5.g3480 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/