USB: pid_ns: ensure pid is not freed during kill_pid_info_as_uid
authorSerge Hallyn <serge.hallyn@canonical.com>
Mon, 26 Sep 2011 15:18:29 +0000 (10:18 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:42:37 +0000 (09:42 -0800)
commitd950e568728e94f7b495214fd887aea2a07f0d05
tree10bba9c0366c57b84175304beb83b9c8666f186f
parent54a996b2eb057a5d375ab33425a0b2d24567219b
USB: pid_ns: ensure pid is not freed during kill_pid_info_as_uid

commit aec01c5895051849ed842dc5b8794017a7751f28 upstream.

Alan Stern points out that after spin_unlock(&ps->lock) there is no
guarantee that ps->pid won't be freed.  Since kill_pid_info_as_uid() is
called after the spin_unlock(), the pid passed to it must be pinned.

Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/devio.c