Skip to content

Commit

Permalink
[patch 2/2] Use find_task_by_vpid in audit code
Browse files Browse the repository at this point in the history
The pid to lookup a task by is passed inside audit code via netlink message.

Thanks to Denis Lunev, netlink packets are now (since 2.6.24) _always_
processed in the context of the sending task.  So this is correct to lookup
the task with find_task_by_vpid() here.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Pavel Emelyanov authored and Al Viro committed Apr 28, 2008
1 parent 4112622 commit 4a761b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static int audit_prepare_user_tty(pid_t pid, uid_t loginuid, u32 sessionid)
int err;

read_lock(&tasklist_lock);
tsk = find_task_by_pid(pid);
tsk = find_task_by_vpid(pid);
err = -ESRCH;
if (!tsk)
goto out;
Expand Down Expand Up @@ -871,7 +871,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
struct task_struct *tsk;

read_lock(&tasklist_lock);
tsk = find_task_by_pid(pid);
tsk = find_task_by_vpid(pid);
if (!tsk)
err = -ESRCH;
else {
Expand All @@ -894,7 +894,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
if (s->enabled != 0 && s->enabled != 1)
return -EINVAL;
read_lock(&tasklist_lock);
tsk = find_task_by_pid(pid);
tsk = find_task_by_vpid(pid);
if (!tsk)
err = -ESRCH;
else {
Expand Down

0 comments on commit 4a761b8

Please sign in to comment.