Blob Blame History Raw
From: Paul Moore <paul@paul-moore.com>
Date: Fri, 3 Jul 2020 09:17:17 -0400
Subject: audit: use the proper gfp flags in the audit_log_nfcfg() calls
Patch-mainline: v5.9-rc1
Git-commit: 68df2ed54487679f815d61b750d3bcf733ffd79e
References: bsc#1176447

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>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 net/netfilter/nf_tables_api.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -5940,7 +5940,7 @@ static int nf_tables_dump_obj(struct sk_
 				goto cont;
 
 			if (reset) {
-				char *buf = kasprintf(GFP_KERNEL,
+				char *buf = kasprintf(GFP_ATOMIC,
 						      "%s:%llu;?:0",
 						      table->name,
 						      table->handle);
@@ -5949,7 +5949,7 @@ static int nf_tables_dump_obj(struct sk_
 						family,
 						obj->handle,
 						AUDIT_NFT_OP_OBJ_RESET,
-						GFP_KERNEL);
+						GFP_ATOMIC);
 				kfree(buf);
 			}
 
@@ -6071,7 +6071,7 @@ static int nf_tables_getobj(struct net *
 				family,
 				obj->handle,
 				AUDIT_NFT_OP_OBJ_RESET,
-				GFP_KERNEL);
+				GFP_ATOMIC);
 		kfree(buf);
 	}
 
@@ -6159,7 +6159,7 @@ void nft_obj_notify(struct net *net, con
 			event == NFT_MSG_NEWOBJ ?
 				AUDIT_NFT_OP_OBJ_REGISTER :
 				AUDIT_NFT_OP_OBJ_UNREGISTER,
-			GFP_KERNEL);
+			gfp);
 	kfree(buf);
 
 	if (!report &&