All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls
@ 2020-07-03 13:36 ` Paul Moore
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-07-03 13:36 UTC (permalink / raw)
  To: linux-audit; +Cc: Richard Guy Briggs, Jones Desougi, netfilter-devel

Commit 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
incorrectly passed gfp flags to audit_log_nfcfg() which were not
consistent with the calling function, this commit fixes that.

Fixes: 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
Reported-by: Jones Desougi <jones.desougi+netfilter@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 net/netfilter/nf_tables_api.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index f7ff91479647..886e64291f41 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5953,7 +5953,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
 				goto cont;
 
 			if (reset) {
-				char *buf = kasprintf(GFP_KERNEL,
+				char *buf = kasprintf(GFP_ATOMIC,
 						      "%s:%llu;?:0",
 						      table->name,
 						      table->handle);
@@ -5962,7 +5962,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
 						family,
 						obj->handle,
 						AUDIT_NFT_OP_OBJ_RESET,
-						GFP_KERNEL);
+						GFP_ATOMIC);
 				kfree(buf);
 			}
 
@@ -6084,7 +6084,7 @@ static int nf_tables_getobj(struct net *net, struct sock *nlsk,
 				family,
 				obj->handle,
 				AUDIT_NFT_OP_OBJ_RESET,
-				GFP_KERNEL);
+				GFP_ATOMIC);
 		kfree(buf);
 	}
 
@@ -6172,7 +6172,7 @@ void nft_obj_notify(struct net *net, const struct nft_table *table,
 			event == NFT_MSG_NEWOBJ ?
 				AUDIT_NFT_OP_OBJ_REGISTER :
 				AUDIT_NFT_OP_OBJ_UNREGISTER,
-			GFP_KERNEL);
+			gfp);
 	kfree(buf);
 
 	if (!report &&


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

* [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls
@ 2020-07-03 13:36 ` Paul Moore
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-07-03 13:36 UTC (permalink / raw)
  To: linux-audit; +Cc: Richard Guy Briggs, netfilter-devel, Jones Desougi

Commit 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
incorrectly passed gfp flags to audit_log_nfcfg() which were not
consistent with the calling function, this commit fixes that.

Fixes: 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
Reported-by: Jones Desougi <jones.desougi+netfilter@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 net/netfilter/nf_tables_api.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index f7ff91479647..886e64291f41 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5953,7 +5953,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
 				goto cont;
 
 			if (reset) {
-				char *buf = kasprintf(GFP_KERNEL,
+				char *buf = kasprintf(GFP_ATOMIC,
 						      "%s:%llu;?:0",
 						      table->name,
 						      table->handle);
@@ -5962,7 +5962,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
 						family,
 						obj->handle,
 						AUDIT_NFT_OP_OBJ_RESET,
-						GFP_KERNEL);
+						GFP_ATOMIC);
 				kfree(buf);
 			}
 
@@ -6084,7 +6084,7 @@ static int nf_tables_getobj(struct net *net, struct sock *nlsk,
 				family,
 				obj->handle,
 				AUDIT_NFT_OP_OBJ_RESET,
-				GFP_KERNEL);
+				GFP_ATOMIC);
 		kfree(buf);
 	}
 
@@ -6172,7 +6172,7 @@ void nft_obj_notify(struct net *net, const struct nft_table *table,
 			event == NFT_MSG_NEWOBJ ?
 				AUDIT_NFT_OP_OBJ_REGISTER :
 				AUDIT_NFT_OP_OBJ_UNREGISTER,
-			GFP_KERNEL);
+			gfp);
 	kfree(buf);
 
 	if (!report &&

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


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

* Re: [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls
  2020-07-03 13:36 ` Paul Moore
@ 2020-07-03 20:25   ` Richard Guy Briggs
  -1 siblings, 0 replies; 6+ messages in thread
From: Richard Guy Briggs @ 2020-07-03 20:25 UTC (permalink / raw)
  To: Paul Moore; +Cc: linux-audit, Jones Desougi, netfilter-devel

On 2020-07-03 09:36, Paul Moore wrote:
> Commit 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> incorrectly passed gfp flags to audit_log_nfcfg() which were not
> consistent with the calling function, this commit fixes that.
> 
> Fixes: 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> Reported-by: Jones Desougi <jones.desougi+netfilter@gmail.com>
> Signed-off-by: Paul Moore <paul@paul-moore.com>

Looks good to me.  For what it's worth:

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

> ---
>  net/netfilter/nf_tables_api.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index f7ff91479647..886e64291f41 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -5953,7 +5953,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
>  				goto cont;
>  
>  			if (reset) {
> -				char *buf = kasprintf(GFP_KERNEL,
> +				char *buf = kasprintf(GFP_ATOMIC,
>  						      "%s:%llu;?:0",
>  						      table->name,
>  						      table->handle);
> @@ -5962,7 +5962,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
>  						family,
>  						obj->handle,
>  						AUDIT_NFT_OP_OBJ_RESET,
> -						GFP_KERNEL);
> +						GFP_ATOMIC);
>  				kfree(buf);
>  			}
>  
> @@ -6084,7 +6084,7 @@ static int nf_tables_getobj(struct net *net, struct sock *nlsk,
>  				family,
>  				obj->handle,
>  				AUDIT_NFT_OP_OBJ_RESET,
> -				GFP_KERNEL);
> +				GFP_ATOMIC);
>  		kfree(buf);
>  	}
>  
> @@ -6172,7 +6172,7 @@ void nft_obj_notify(struct net *net, const struct nft_table *table,
>  			event == NFT_MSG_NEWOBJ ?
>  				AUDIT_NFT_OP_OBJ_REGISTER :
>  				AUDIT_NFT_OP_OBJ_UNREGISTER,
> -			GFP_KERNEL);
> +			gfp);
>  	kfree(buf);
>  
>  	if (!report &&
> 

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635


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

* Re: [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls
@ 2020-07-03 20:25   ` Richard Guy Briggs
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Guy Briggs @ 2020-07-03 20:25 UTC (permalink / raw)
  To: Paul Moore; +Cc: linux-audit, netfilter-devel, Jones Desougi

On 2020-07-03 09:36, Paul Moore wrote:
> Commit 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> incorrectly passed gfp flags to audit_log_nfcfg() which were not
> consistent with the calling function, this commit fixes that.
> 
> Fixes: 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> Reported-by: Jones Desougi <jones.desougi+netfilter@gmail.com>
> Signed-off-by: Paul Moore <paul@paul-moore.com>

Looks good to me.  For what it's worth:

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

> ---
>  net/netfilter/nf_tables_api.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index f7ff91479647..886e64291f41 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -5953,7 +5953,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
>  				goto cont;
>  
>  			if (reset) {
> -				char *buf = kasprintf(GFP_KERNEL,
> +				char *buf = kasprintf(GFP_ATOMIC,
>  						      "%s:%llu;?:0",
>  						      table->name,
>  						      table->handle);
> @@ -5962,7 +5962,7 @@ static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb)
>  						family,
>  						obj->handle,
>  						AUDIT_NFT_OP_OBJ_RESET,
> -						GFP_KERNEL);
> +						GFP_ATOMIC);
>  				kfree(buf);
>  			}
>  
> @@ -6084,7 +6084,7 @@ static int nf_tables_getobj(struct net *net, struct sock *nlsk,
>  				family,
>  				obj->handle,
>  				AUDIT_NFT_OP_OBJ_RESET,
> -				GFP_KERNEL);
> +				GFP_ATOMIC);
>  		kfree(buf);
>  	}
>  
> @@ -6172,7 +6172,7 @@ void nft_obj_notify(struct net *net, const struct nft_table *table,
>  			event == NFT_MSG_NEWOBJ ?
>  				AUDIT_NFT_OP_OBJ_REGISTER :
>  				AUDIT_NFT_OP_OBJ_UNREGISTER,
> -			GFP_KERNEL);
> +			gfp);
>  	kfree(buf);
>  
>  	if (!report &&
> 

- RGB

--
Richard Guy Briggs <rgb@redhat.com>
Sr. S/W Engineer, Kernel Security, Base Operating Systems
Remote, Ottawa, Red Hat Canada
IRC: rgb, SunRaycer
Voice: +1.647.777.2635, Internal: (81) 32635

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


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

* Re: [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls
  2020-07-03 20:25   ` Richard Guy Briggs
@ 2020-07-08 22:27     ` Paul Moore
  -1 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-07-08 22:27 UTC (permalink / raw)
  To: Richard Guy Briggs; +Cc: linux-audit, Jones Desougi, netfilter-devel

On Fri, Jul 3, 2020 at 4:26 PM Richard Guy Briggs <rgb@redhat.com> wrote:
>
> On 2020-07-03 09:36, Paul Moore wrote:
> > Commit 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> > incorrectly passed gfp flags to audit_log_nfcfg() which were not
> > consistent with the calling function, this commit fixes that.
> >
> > Fixes: 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> > Reported-by: Jones Desougi <jones.desougi+netfilter@gmail.com>
> > Signed-off-by: Paul Moore <paul@paul-moore.com>
>
> Looks good to me.  For what it's worth:

Thanks, applied to audit/next.  Also, for the record, reviews are
always welcome; I really dislike merging my own patches without
reviews.  Sometimes it needs to be done to fix a serious fault, build
error, etc. but in general I'm of the opinion that maintainer patches
should be treated just the same as any other patch.

> Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

-- 
paul moore
www.paul-moore.com

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

* Re: [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls
@ 2020-07-08 22:27     ` Paul Moore
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Moore @ 2020-07-08 22:27 UTC (permalink / raw)
  To: Richard Guy Briggs; +Cc: linux-audit, netfilter-devel, Jones Desougi

On Fri, Jul 3, 2020 at 4:26 PM Richard Guy Briggs <rgb@redhat.com> wrote:
>
> On 2020-07-03 09:36, Paul Moore wrote:
> > Commit 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> > incorrectly passed gfp flags to audit_log_nfcfg() which were not
> > consistent with the calling function, this commit fixes that.
> >
> > Fixes: 142240398e50 ("audit: add gfp parameter to audit_log_nfcfg")
> > Reported-by: Jones Desougi <jones.desougi+netfilter@gmail.com>
> > Signed-off-by: Paul Moore <paul@paul-moore.com>
>
> Looks good to me.  For what it's worth:

Thanks, applied to audit/next.  Also, for the record, reviews are
always welcome; I really dislike merging my own patches without
reviews.  Sometimes it needs to be done to fix a serious fault, build
error, etc. but in general I'm of the opinion that maintainer patches
should be treated just the same as any other patch.

> Reviewed-by: Richard Guy Briggs <rgb@redhat.com>

-- 
paul moore
www.paul-moore.com

--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit


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

end of thread, other threads:[~2020-07-08 22:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03 13:36 [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls Paul Moore
2020-07-03 13:36 ` Paul Moore
2020-07-03 20:25 ` Richard Guy Briggs
2020-07-03 20:25   ` Richard Guy Briggs
2020-07-08 22:27   ` Paul Moore
2020-07-08 22:27     ` Paul Moore

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.