diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2014-04-23 03:31:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-23 03:42:27 +0200 |
commit | 7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638 (patch) | |
tree | 1b931b6b57e26b4f4fdfba0cb928fd55731493ad /kernel/audit.c | |
parent | audit: add netlink multicast group for log read (diff) | |
download | linux-7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638.tar.xz linux-7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638.zip |
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/audit.c')
-rw-r--r-- | kernel/audit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index d272cc11dff4..33531d72e4a2 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 |