diff options
author | Richard Guy Briggs <rgb@redhat.com> | 2014-04-22 21:31:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-22 21:42:27 -0400 |
commit | 7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638 (patch) | |
tree | 1b931b6b57e26b4f4fdfba0cb928fd55731493ad /kernel/audit.c | |
parent | 451f921639fea4600dfb9ab2889332bdcc7b48d3 (diff) | |
download | lwn-7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638.tar.gz lwn-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 |