From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Guy Briggs Subject: [PATCH 6/6] audit: send multicast messages only if there are listeners Date: Thu, 24 Jan 2013 13:15:15 -0500 Message-ID: <1359051315-20905-7-git-send-email-rgb@redhat.com> References: <1359051315-20905-1-git-send-email-rgb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1359051315-20905-1-git-send-email-rgb@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com Cc: Richard Guy Briggs List-Id: linux-audit@redhat.com 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 --- kernel/audit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/audit.c b/kernel/audit.c index 9eef05b..d153a6b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -428,6 +428,8 @@ static void kauditd_send_multicast_skb(struct sk_buff *skb) struct sk_buff *copy; struct nlmsghdr *nlh; + if (!netlink_has_listeners(audit_sock, AUDIT_NLGRP_READLOG)) + return; /* * The seemingly wasteful skb_copy() is necessary because the original * kaudit unicast socket sends up messages with nlmsg_len set to the -- 1.8.0.2