From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu,
stephen@networkplumber.org, davem@davemloft.net,
netfilter-devel@vger.kernel.org,
bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
linux-audit@redhat.com
Cc: nicolas.dichtel@6wind.com
Subject: [PATCH net-next] netfilter: create audit records for ebtables replaces
Date: Fri, 5 Sep 2014 10:50:15 +0200 [thread overview]
Message-ID: <1409907015-6145-1-git-send-email-nicolas.dichtel@6wind.com> (raw)
This is already done for x_tables (family AF_INET and AF_INET6), let's do it
for AF_BRIDGE also.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/bridge/netfilter/ebtables.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 6d69631b9f4d..4ba0c5c78778 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -26,6 +26,7 @@
#include <asm/uaccess.h>
#include <linux/smp.h>
#include <linux/cpumask.h>
+#include <linux/audit.h>
#include <net/sock.h>
/* needed for logical [in,out]-dev filtering */
#include "../br_private.h"
@@ -1126,6 +1127,20 @@ static int do_replace(struct net *net, const void __user *user,
}
ret = do_replace_finish(net, &tmp, newinfo);
+#ifdef CONFIG_AUDIT
+ if (audit_enabled) {
+ struct audit_buffer *ab;
+
+ ab = audit_log_start(current->audit_context, GFP_KERNEL,
+ AUDIT_NETFILTER_CFG);
+ if (ab) {
+ audit_log_format(ab, "table=%s family=%u entries=%u",
+ tmp.name, AF_BRIDGE,
+ tmp.nentries);
+ audit_log_end(ab);
+ }
+ }
+#endif
if (ret == 0)
return ret;
free_entries:
--
1.9.0
next reply other threads:[~2014-09-05 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-05 8:50 Nicolas Dichtel [this message]
2014-09-07 16:07 ` [PATCH net-next] netfilter: create audit records for ebtables replaces Pablo Neira Ayuso
2014-09-08 12:11 ` Nicolas Dichtel
2014-09-09 10:11 ` Pablo Neira Ayuso
2014-09-08 14:02 ` Richard Guy Briggs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409907015-6145-1-git-send-email-nicolas.dichtel@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-audit@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).