From: Richard Guy Briggs Date: Wed, 23 Apr 2014 01:31:58 +0000 (-0400) Subject: audit: send multicast messages only if there are listeners X-Git-Tag: v3.16-rc1~27^2~340^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f74ecd788a8b2a122d4d8bdc4d517cc60b8b638;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: David S. Miller --- 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