From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 949CBC433E0 for ; Fri, 3 Jul 2020 13:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EE9E206A1 for ; Fri, 3 Jul 2020 13:37:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore-com.20150623.gappssmtp.com header.i=@paul-moore-com.20150623.gappssmtp.com header.b="dZh9boHd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726053AbgGCNhB (ORCPT ); Fri, 3 Jul 2020 09:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbgGCNhA (ORCPT ); Fri, 3 Jul 2020 09:37:00 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7B41C08C5C1 for ; Fri, 3 Jul 2020 06:36:59 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id z2so23889690qts.5 for ; Fri, 03 Jul 2020 06:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:cc:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=bJmqwWFrAIe8ZK9B67ZPHMKhCaBXUrrmbgzZcvhmbT0=; b=dZh9boHdF4CV11P788Y8JP2c5xURiKXVazqK2lO7mdweMMZcXJjOk2sIaHbw3jbsNZ 5G5RcdqN/K5QpZOgOxWucXb7xtSwDMekIdxRGTlYxnnRpYH2PAviNTD+ro/SXcHBirTg AHsotLs4MhCqLG/4jqKNxeMoMmuob+Sq7ApapzRNxSAvSF1Gsyzy/kGN38ql6Qy2PzoD LVz/gfjwRhT4w01ZaQSiaYeSiSum/dl5v9f9vJAGcVRPKeyvuJGCxeXwWwK8jdyPm3jT uOWB2H+EnuKEAo9qq++2iCCH1TKtYc50mHx5IbG9LosAHBlyVcSq4GXb7X+LyVDmQHZM bKKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=bJmqwWFrAIe8ZK9B67ZPHMKhCaBXUrrmbgzZcvhmbT0=; b=WsRNc8Pp9TlprQLtY0cGof1jfz937/8sIy5iRRzVpfO/jYps2baJH9C5elCudGXAyH 2HHs2pixTXQn+D4caEXpGlwrEt9+BINtmd1wNQT5MJDOry3qojoOW2lR3XefLa4rAyUQ /Pw+DaduNY4++ml4HcEj71shv8cz1oM9r6V2RvGJ01/NrZlUUST80z8fExbglsBxdS3H HtEKlcNh8uZ2omeSKUQpyUAiAHFjWohI7LhGJPTDHxLhOgIGtI0jyzN8k4bYd1URmnUV /uKmhhGztJ9M5LVNacTbMzW18VTJGUeez5IHPjlc8hRgq6mDk8rnYO6DIszUItg+EpHq EBOw== X-Gm-Message-State: AOAM533cQqwTduQuZCGJlgl8x2N882zpzAVENHeOtvrfEZ40SlQToltl EfHyqG+rwY4lHvhT3VPj6I43 X-Google-Smtp-Source: ABdhPJweXHQZCIZ09TB4Ia4NsEfzcvCSUK/hSin/naGrWBqifP4aa9aCMw3X9VjaQpv/M+00tWAIMA== X-Received: by 2002:ac8:5484:: with SMTP id h4mr35754240qtq.322.1593783418831; Fri, 03 Jul 2020 06:36:58 -0700 (PDT) Received: from localhost (pool-96-230-24-152.bstnma.fios.verizon.net. [96.230.24.152]) by smtp.gmail.com with ESMTPSA id z68sm10734785qke.113.2020.07.03.06.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 06:36:58 -0700 (PDT) Subject: [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls From: Paul Moore To: linux-audit@redhat.com Cc: Richard Guy Briggs , Jones Desougi , netfilter-devel@vger.kernel.org Date: Fri, 03 Jul 2020 09:36:56 -0400 Message-ID: <159378341669.5956.13490174029711421419.stgit@sifl> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org 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 Signed-off-by: Paul Moore --- 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 && From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D4C8C433E0 for ; Fri, 3 Jul 2020 13:37:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 25461206A1 for ; Fri, 3 Jul 2020 13:37:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25461206A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=paul-moore.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-audit-bounces@redhat.com Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-w1sVVfc9PEGQyTrbwB7O2g-1; Fri, 03 Jul 2020 09:37:12 -0400 X-MC-Unique: w1sVVfc9PEGQyTrbwB7O2g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA91B107ACCD; Fri, 3 Jul 2020 13:37:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA7042DE8F; Fri, 3 Jul 2020 13:37:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3E68A1809547; Fri, 3 Jul 2020 13:37:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 063Db4Nx008134 for ; Fri, 3 Jul 2020 09:37:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 11B181007A49; Fri, 3 Jul 2020 13:37:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D73C112C06E for ; Fri, 3 Jul 2020 13:37:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DD81A8EF3A3 for ; Fri, 3 Jul 2020 13:37:01 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-2-9dal217oNY20uhXiqiStXw-1; Fri, 03 Jul 2020 09:37:00 -0400 X-MC-Unique: 9dal217oNY20uhXiqiStXw-1 Received: by mail-qt1-f193.google.com with SMTP id e12so23854437qtr.9 for ; Fri, 03 Jul 2020 06:36:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=bJmqwWFrAIe8ZK9B67ZPHMKhCaBXUrrmbgzZcvhmbT0=; b=LIbP8+TESXTOltkc5btqQ4dV1JWRoI+Ive81y/Jian0WrPaE4uOC9ZU+rLXSVh61om IkFA494+VjcdGuMEGKNOC5wDfxXOSSnFYLev1fXFBFVqYCjrBQ4q/j8/vbp3/CdKo51/ T/zYsZ5ndfIgc70yB0vucsebTWnLagdiF0B+5J74IrZl+trYUbze5UXEajXvWepNHuFm lj55NPAiRqncyK7JRtj1EUCPYAg2KMe/2T4CkFzZr4RV1tX7e/9I6dR7IrVZUoC7O2jO 183TUJBEvf8kG2F6T8aNKRQAMadM81Et+ueHg3U++cb1vK7QpU/4Ibd4pCjVvdruE1F+ Uw1g== X-Gm-Message-State: AOAM533IQi8btfeCa6UuixRa6LhdGQzKVjsvhsikgWje3I1OaZMQjG9t TOzAstJr8P7NJJ9AkKgBvB38oILe8w== X-Google-Smtp-Source: ABdhPJweXHQZCIZ09TB4Ia4NsEfzcvCSUK/hSin/naGrWBqifP4aa9aCMw3X9VjaQpv/M+00tWAIMA== X-Received: by 2002:ac8:5484:: with SMTP id h4mr35754240qtq.322.1593783418831; Fri, 03 Jul 2020 06:36:58 -0700 (PDT) Received: from localhost (pool-96-230-24-152.bstnma.fios.verizon.net. [96.230.24.152]) by smtp.gmail.com with ESMTPSA id z68sm10734785qke.113.2020.07.03.06.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 06:36:58 -0700 (PDT) Subject: [PATCH] audit: use the proper gfp flags in the audit_log_nfcfg() calls From: Paul Moore To: linux-audit@redhat.com Date: Fri, 03 Jul 2020 09:36:56 -0400 Message-ID: <159378341669.5956.13490174029711421419.stgit@sifl> User-Agent: StGit/0.23 MIME-Version: 1.0 X-Mimecast-Bulk-Signature: yes X-Mimecast-Spam-Signature: bulk X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: linux-audit@redhat.com Cc: Richard Guy Briggs , netfilter-devel@vger.kernel.org, Jones Desougi X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Signed-off-by: Paul Moore --- 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