Commit e1b0d4ba authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Tony Luck

[IA64] make pfm_get_task work with virtual pids

This pid comes from user space, so treat it accordingly.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent 620de2f5
...@@ -2654,11 +2654,11 @@ pfm_get_task(pfm_context_t *ctx, pid_t pid, struct task_struct **task) ...@@ -2654,11 +2654,11 @@ pfm_get_task(pfm_context_t *ctx, pid_t pid, struct task_struct **task)
/* XXX: need to add more checks here */ /* XXX: need to add more checks here */
if (pid < 2) return -EPERM; if (pid < 2) return -EPERM;
if (pid != current->pid) { if (pid != task_pid_vnr(current)) {
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
p = find_task_by_pid(pid); p = find_task_by_vpid(pid);
/* make sure task cannot go away while we operate on it */ /* make sure task cannot go away while we operate on it */
if (p) get_task_struct(p); if (p) get_task_struct(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment