summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2014-04-22 21:31:58 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-22 21:42:27 -0400
commit7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638 (patch)
tree1b931b6b57e26b4f4fdfba0cb928fd55731493ad /kernel
parent451f921639fea4600dfb9ab2889332bdcc7b48d3 (diff)
downloadop-kernel-dev-7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638.zip
op-kernel-dev-7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638.tar.gz
audit: send multicast messages only if there are listeners
Test first to see if there are any userspace multicast listeners bound to the socket before starting the multicast send work. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index d272cc1..33531d7 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -435,6 +435,9 @@ static void kauditd_send_multicast_skb(struct sk_buff *skb)
struct audit_net *aunet = net_generic(&init_net, audit_net_id);
struct sock *sock = aunet->nlsk;
+ if (!netlink_has_listeners(sock, AUDIT_NLGRP_READLOG))
+ return;
+
/*
* The seemingly wasteful skb_copy() rather than bumping the refcount
* using skb_get() is necessary because non-standard mods are made to
OpenPOWER on IntegriCloud