All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] netfilter: create audit records for ebtables replaces
@ 2014-09-05  8:57 ` Nicolas Dichtel
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dichtel @ 2014-09-05  8:50 UTC (permalink / raw)
  To: pablo, kaber, kadlec, stephen, davem, netfilter-devel, bridge,
	netdev, linux-audit
  Cc: nicolas.dichtel

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Bridge] [PATCH net-next] netfilter: create audit records for ebtables replaces
@ 2014-09-05  8:57 ` Nicolas Dichtel
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dichtel @ 2014-09-05  8:57 UTC (permalink / raw)
  To: pablo, kaber, kadlec, stephen, davem, netfilter-devel, bridge,
	netdev, linux-audit
  Cc: nicolas.dichtel

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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next] netfilter: create audit records for ebtables replaces
  2014-09-05  8:57 ` [Bridge] " Nicolas Dichtel
@ 2014-09-07 16:07   ` Pablo Neira Ayuso
  -1 siblings, 0 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2014-09-07 16:07 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: kaber, kadlec, stephen, davem, netfilter-devel, bridge, netdev,
	linux-audit

On Fri, Sep 05, 2014 at 10:50:15AM +0200, Nicolas Dichtel wrote:
> 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

This chunks belongs to do_replace_finish(). We still need the audit
code for compat_do_replace() and iff there are no errors when
replacing the table.

>  	if (ret == 0)
>  		return ret;
>  free_entries:
> -- 
> 1.9.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bridge] [PATCH net-next] netfilter: create audit records for ebtables replaces
@ 2014-09-07 16:07   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2014-09-07 16:07 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: netdev, bridge, kaber, stephen, linux-audit, netfilter-devel,
	kadlec, davem

On Fri, Sep 05, 2014 at 10:50:15AM +0200, Nicolas Dichtel wrote:
> 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

This chunks belongs to do_replace_finish(). We still need the audit
code for compat_do_replace() and iff there are no errors when
replacing the table.

>  	if (ret == 0)
>  		return ret;
>  free_entries:
> -- 
> 1.9.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net-next] netfilter: create audit records for ebtables replaces
  2014-09-07 16:07   ` [Bridge] " Pablo Neira Ayuso
@ 2014-09-08 12:11     ` Nicolas Dichtel
  -1 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dichtel @ 2014-09-08 12:11 UTC (permalink / raw)
  To: pablo, kaber, kadlec, stephen, davem, netfilter-devel, bridge,
	netdev, linux-audit
  Cc: nicolas.dichtel

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>
---

v2: move audit chunks to do_replace_finish()

 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..d9a8c05d995d 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"
@@ -1058,6 +1059,20 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
 	vfree(table);
 
 	vfree(counterstmp);
+
+#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",
+					 repl->name, AF_BRIDGE, repl->nentries);
+			audit_log_end(ab);
+		}
+	}
+#endif
 	return ret;
 
 free_unlock:
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Bridge] [PATCH net-next] netfilter: create audit records for ebtables replaces
@ 2014-09-08 12:11     ` Nicolas Dichtel
  0 siblings, 0 replies; 10+ messages in thread
From: Nicolas Dichtel @ 2014-09-08 12:11 UTC (permalink / raw)
  To: pablo, kaber, kadlec, stephen, davem, netfilter-devel, bridge,
	netdev, linux-audit
  Cc: nicolas.dichtel

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>
---

v2: move audit chunks to do_replace_finish()

 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..d9a8c05d995d 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"
@@ -1058,6 +1059,20 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
 	vfree(table);
 
 	vfree(counterstmp);
+
+#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",
+					 repl->name, AF_BRIDGE, repl->nentries);
+			audit_log_end(ab);
+		}
+	}
+#endif
 	return ret;
 
 free_unlock:
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next] netfilter: create audit records for ebtables replaces
  2014-09-05  8:57 ` [Bridge] " Nicolas Dichtel
@ 2014-09-08 14:07   ` Richard Guy Briggs
  -1 siblings, 0 replies; 10+ messages in thread
From: Richard Guy Briggs @ 2014-09-08 14:02 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: pablo, kaber, kadlec, stephen, davem, netfilter-devel, bridge,
	netdev, linux-audit

On 14/09/05, Nicolas Dichtel wrote:
> 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>

ACK.

> ---
>  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
> 
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bridge] [PATCH net-next] netfilter: create audit records for ebtables replaces
@ 2014-09-08 14:07   ` Richard Guy Briggs
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Guy Briggs @ 2014-09-08 14:07 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: netdev, bridge, kaber, stephen, linux-audit, netfilter-devel,
	kadlec, davem, pablo

On 14/09/05, Nicolas Dichtel wrote:
> 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>

ACK.

> ---
>  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
> 
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit

- RGB

--
Richard Guy Briggs <rbriggs@redhat.com>
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next] netfilter: create audit records for ebtables replaces
  2014-09-08 12:11     ` [Bridge] " Nicolas Dichtel
@ 2014-09-09 10:11       ` Pablo Neira Ayuso
  -1 siblings, 0 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2014-09-09 10:11 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: kaber, kadlec, stephen, davem, netfilter-devel, bridge, netdev,
	linux-audit

On Mon, Sep 08, 2014 at 02:11:45PM +0200, Nicolas Dichtel wrote:
> This is already done for x_tables (family AF_INET and AF_INET6), let's do it
> for AF_BRIDGE also.

Applied, thanks Nicolas.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Bridge] [PATCH net-next] netfilter: create audit records for ebtables replaces
@ 2014-09-09 10:11       ` Pablo Neira Ayuso
  0 siblings, 0 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2014-09-09 10:11 UTC (permalink / raw)
  To: Nicolas Dichtel
  Cc: netdev, bridge, kaber, stephen, linux-audit, netfilter-devel,
	kadlec, davem

On Mon, Sep 08, 2014 at 02:11:45PM +0200, Nicolas Dichtel wrote:
> This is already done for x_tables (family AF_INET and AF_INET6), let's do it
> for AF_BRIDGE also.

Applied, thanks Nicolas.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-09-09 10:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-05  8:50 [PATCH net-next] netfilter: create audit records for ebtables replaces Nicolas Dichtel
2014-09-05  8:57 ` [Bridge] " Nicolas Dichtel
2014-09-07 16:07 ` Pablo Neira Ayuso
2014-09-07 16:07   ` [Bridge] " Pablo Neira Ayuso
2014-09-08 12:11   ` Nicolas Dichtel
2014-09-08 12:11     ` [Bridge] " Nicolas Dichtel
2014-09-09 10:11     ` Pablo Neira Ayuso
2014-09-09 10:11       ` [Bridge] " Pablo Neira Ayuso
2014-09-08 14:02 ` Richard Guy Briggs
2014-09-08 14:07   ` [Bridge] " Richard Guy Briggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.