user namespace: usb: make usb urbs user namespace aware (v2)
authorSerge Hallyn <serge.hallyn@canonical.com>
Mon, 26 Sep 2011 15:45:18 +0000 (10:45 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 29 Sep 2011 20:13:08 +0000 (13:13 -0700)
commitd178bc3a708f39cbfefc3fab37032d3f2511b4ec
treeaf492e92e140f1f6abad5a377a269ef7335824de
parentedb2b255a0bebac5aeb17c7613aeb76ba4e6c63c
user namespace: usb: make usb urbs user namespace aware (v2)

Add to the dev_state and alloc_async structures the user namespace
corresponding to the uid and euid.  Pass these to kill_pid_info_as_uid(),
which can then implement a proper, user-namespace-aware uid check.

Changelog:
Sep 20: Per Oleg's suggestion: Instead of caching and passing user namespace,
uid, and euid each separately, pass a struct cred.
Sep 26: Address Alan Stern's comments: don't define a struct cred at
usbdev_open(), and take and put a cred at async_completed() to
ensure it lasts for the duration of kill_pid_info_as_cred().

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c
include/linux/sched.h
kernel/signal.c