get_pid_cred(): proper locking around pid_task
This commit is contained in:
@@ -249,7 +249,9 @@ get_pid_cred(int pid)
|
|||||||
struct task_struct *task = NULL;
|
struct task_struct *task = NULL;
|
||||||
|
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
|
rcu_read_lock();
|
||||||
task = pid_task(find_vpid(pid), PIDTYPE_PID);
|
task = pid_task(find_vpid(pid), PIDTYPE_PID);
|
||||||
|
rcu_read_unlock();
|
||||||
if (task) {
|
if (task) {
|
||||||
return __task_cred(task);
|
return __task_cred(task);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user