]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
audit: use the proper gfp flags in the audit_log_nfcfg() calls
authorPaul Moore <paul@paul-moore.com>
Fri, 3 Jul 2020 13:17:17 +0000 (09:17 -0400)
committerPaul Moore <paul@paul-moore.com>
Wed, 8 Jul 2020 22:22:47 +0000 (18:22 -0400)
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>
net/netfilter/nf_tables_api.c

index f7ff914796476e42f10a82822496c42df2aade6f..886e64291f41f1bb32f207ace8282c5c0d1dd355 100644 (file)
@@ -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 &&