aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-04-18 16:30:15 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-04-28 06:28:30 -0400
commit4a761b8c1d7a3a4ee7ccf92ce255d986f601e067 (patch)
treecb93a5cca0d3e29b79c4dd0bb27755f967c325af /kernel/audit.c
parent41126226e186d92a45ed664e546abb5204588359 (diff)
[patch 2/2] Use find_task_by_vpid in audit code
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>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index f4799eb6977a..b7d3709cc452 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -455,7 +455,7 @@ static int audit_prepare_user_tty(pid_t pid, uid_t loginuid, u32 sessionid)
455 int err; 455 int err;
456 456
457 read_lock(&tasklist_lock); 457 read_lock(&tasklist_lock);
458 tsk = find_task_by_pid(pid); 458 tsk = find_task_by_vpid(pid);
459 err = -ESRCH; 459 err = -ESRCH;
460 if (!tsk) 460 if (!tsk)
461 goto out; 461 goto out;
@@ -871,7 +871,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
871 struct task_struct *tsk; 871 struct task_struct *tsk;
872 872
873 read_lock(&tasklist_lock); 873 read_lock(&tasklist_lock);
874 tsk = find_task_by_pid(pid); 874 tsk = find_task_by_vpid(pid);
875 if (!tsk) 875 if (!tsk)
876 err = -ESRCH; 876 err = -ESRCH;
877 else { 877 else {
@@ -894,7 +894,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
894 if (s->enabled != 0 && s->enabled != 1) 894 if (s->enabled != 0 && s->enabled != 1)
895 return -EINVAL; 895 return -EINVAL;
896 read_lock(&tasklist_lock); 896 read_lock(&tasklist_lock);
897 tsk = find_task_by_pid(pid); 897 tsk = find_task_by_vpid(pid);
898 if (!tsk) 898 if (!tsk)
899 err = -ESRCH; 899 err = -ESRCH;
900 else { 900 else {