aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/audit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 0572e5dcfda7..b447a6b1fdc8 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -468,6 +468,10 @@ static int kauditd_send_unicast_skb(struct sk_buff *skb)
468{ 468{
469 int rc; 469 int rc;
470 470
471 /* if we know nothing is connected, don't even try the netlink call */
472 if (!audit_pid)
473 return -ECONNREFUSED;
474
471 /* get an extra skb reference in case we fail to send */ 475 /* get an extra skb reference in case we fail to send */
472 skb_get(skb); 476 skb_get(skb);
473 rc = netlink_unicast(audit_sock, skb, audit_nlk_portid, 0); 477 rc = netlink_unicast(audit_sock, skb, audit_nlk_portid, 0);
@@ -1009,6 +1013,8 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
1009 audit_pid = new_pid; 1013 audit_pid = new_pid;
1010 audit_nlk_portid = NETLINK_CB(skb).portid; 1014 audit_nlk_portid = NETLINK_CB(skb).portid;
1011 audit_sock = skb->sk; 1015 audit_sock = skb->sk;
1016 if (!new_pid)
1017 auditd_reset();
1012 wake_up_interruptible(&kauditd_wait); 1018 wake_up_interruptible(&kauditd_wait);
1013 } 1019 }
1014 if (s.mask & AUDIT_STATUS_RATE_LIMIT) { 1020 if (s.mask & AUDIT_STATUS_RATE_LIMIT) {