aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorGao feng <gaofeng@cn.fujitsu.com>2013-04-29 18:05:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:26 -0400
commit13f51e1c3fbebeab801f768f433067ff075dea5a (patch)
treece4c99e262771b82f3c5213d7c0a0a5dc87d5207 /kernel/audit.c
parent3f68613f39cdc242fa2e872ac04a802e7cc7b7cb (diff)
audit: don't check if kauditd is valid every time
We only need to check if kauditd is valid after we start it, if kauditd is invalid, we will set kauditd_task to NULL. So next time, we will start kauditd again. It means if kauditd_task is not NULL,it must be valid. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Cc: Eric Paris <eparis@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index d596e5355f15..9816a1b96cfc 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -660,14 +660,14 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
660 660
661 /* As soon as there's any sign of userspace auditd, 661 /* As soon as there's any sign of userspace auditd,
662 * start kauditd to talk to it */ 662 * start kauditd to talk to it */
663 if (!kauditd_task) 663 if (!kauditd_task) {
664 kauditd_task = kthread_run(kauditd_thread, NULL, "kauditd"); 664 kauditd_task = kthread_run(kauditd_thread, NULL, "kauditd");
665 if (IS_ERR(kauditd_task)) { 665 if (IS_ERR(kauditd_task)) {
666 err = PTR_ERR(kauditd_task); 666 err = PTR_ERR(kauditd_task);
667 kauditd_task = NULL; 667 kauditd_task = NULL;
668 return err; 668 return err;
669 }
669 } 670 }
670
671 loginuid = audit_get_loginuid(current); 671 loginuid = audit_get_loginuid(current);
672 sessionid = audit_get_sessionid(current); 672 sessionid = audit_get_sessionid(current);
673 security_task_getsecid(current, &sid); 673 security_task_getsecid(current, &sid);