[PATCH] usb: fixup usb so it uses struct pid
The problem with remembering a user space process by its pid is that it is possible that the process will exit, pid wrap around will occur. Converting to a struct pid avoid that problem, and paves the way for implementing a pid namespace. Also since usb is the only user of kill_proc_info_as_uid rename kill_proc_info_as_uid to kill_pid_info_as_uid and have the new version take a struct pid. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
43fa1adb93
commit
2425c08b37
@@ -1136,8 +1136,8 @@ kill_proc_info(int sig, struct siginfo *info, pid_t pid)
|
||||
return error;
|
||||
}
|
||||
|
||||
/* like kill_proc_info(), but doesn't use uid/euid of "current" */
|
||||
int kill_proc_info_as_uid(int sig, struct siginfo *info, pid_t pid,
|
||||
/* like kill_pid_info(), but doesn't use uid/euid of "current" */
|
||||
int kill_pid_info_as_uid(int sig, struct siginfo *info, struct pid *pid,
|
||||
uid_t uid, uid_t euid, u32 secid)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
@@ -1147,7 +1147,7 @@ int kill_proc_info_as_uid(int sig, struct siginfo *info, pid_t pid,
|
||||
return ret;
|
||||
|
||||
read_lock(&tasklist_lock);
|
||||
p = find_task_by_pid(pid);
|
||||
p = pid_task(pid, PIDTYPE_PID);
|
||||
if (!p) {
|
||||
ret = -ESRCH;
|
||||
goto out_unlock;
|
||||
@@ -1171,7 +1171,7 @@ out_unlock:
|
||||
read_unlock(&tasklist_lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kill_proc_info_as_uid);
|
||||
EXPORT_SYMBOL_GPL(kill_pid_info_as_uid);
|
||||
|
||||
/*
|
||||
* kill_something_info() interprets pid in interesting ways just like kill(2).
|
||||
|
Reference in New Issue
Block a user