aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2013-01-24 13:15:12 -0500
committerEric Paris <eparis@redhat.com>2013-04-08 16:19:18 -0400
commit6ff5e45985c2fcb97947818f66d1eeaf9d6600b2 (patch)
tree25aac77a82c806eaf75708d9aa7e477f27acb2c4 /kernel/audit.c
parent3320c5133dd83df58b8fbc529b5419e02ca16fe6 (diff)
audit: move kaudit thread start from auditd registration to kaudit init
The kauditd_thread() task was started only after the auditd userspace daemon registers itself with kaudit. This was fine when only auditd consumed messages from the kaudit netlink unicast socket. With the addition of a multicast group to that socket it is more convenient to have the thread start on init of the kaudit kernel subsystem. Signed-off-by: Richard Guy Briggs <rbriggs@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 1531efbd11e2..02a5d9eefa82 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -676,16 +676,6 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
676 if (err) 676 if (err)
677 return err; 677 return err;
678 678
679 /* As soon as there's any sign of userspace auditd,
680 * start kauditd to talk to it */
681 if (!kauditd_task)
682 kauditd_task = kthread_run(kauditd_thread, NULL, "kauditd");
683 if (IS_ERR(kauditd_task)) {
684 err = PTR_ERR(kauditd_task);
685 kauditd_task = NULL;
686 return err;
687 }
688
689 loginuid = audit_get_loginuid(current); 679 loginuid = audit_get_loginuid(current);
690 sessionid = audit_get_sessionid(current); 680 sessionid = audit_get_sessionid(current);
691 security_task_getsecid(current, &sid); 681 security_task_getsecid(current, &sid);
@@ -974,6 +964,10 @@ static int __init audit_init(void)
974 else 964 else
975 audit_sock->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; 965 audit_sock->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;
976 966
967 kauditd_task = kthread_run(kauditd_thread, NULL, "kauditd");
968 if (IS_ERR(kauditd_task))
969 return PTR_ERR(kauditd_task);
970
977 skb_queue_head_init(&audit_skb_queue); 971 skb_queue_head_init(&audit_skb_queue);
978 skb_queue_head_init(&audit_skb_hold_queue); 972 skb_queue_head_init(&audit_skb_hold_queue);
979 audit_initialized = AUDIT_INITIALIZED; 973 audit_initialized = AUDIT_INITIALIZED;