Skip to content

Commit

Permalink
audit: send multicast messages only if there are listeners
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Guy Briggs authored and David S. Miller committed Apr 23, 2014
1 parent 451f921 commit 7f74ecd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7f74ecd

Please sign in to comment.