linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Richard Guy Briggs <rgb@redhat.com>
Cc: Jones Desougi <jones.desougi+netfilter@gmail.com>,
	Phil Sutter <phil@nwl.cc>, Florian Westphal <fw@strlen.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-Audit Mailing List <linux-audit@redhat.com>,
	netfilter-devel@vger.kernel.org, twoerner@redhat.com,
	Eric Paris <eparis@parisplace.org>,
	tgraf@infradead.org, dan.carpenter@oracle.com
Subject: Re: [PATCH v5] audit: log nftables configuration change events once per table
Date: Wed, 31 Mar 2021 22:46:35 +0200	[thread overview]
Message-ID: <20210331204635.GA4634@salvia> (raw)
In-Reply-To: <28de34275f58b45fd4626a92ccae96b6d2b4e287.1616702731.git.rgb@redhat.com>

On Fri, Mar 26, 2021 at 01:38:59PM -0400, Richard Guy Briggs wrote:
> @@ -8006,12 +7966,65 @@ static void nft_commit_notify(struct net *net, u32 portid)
>  	WARN_ON_ONCE(!list_empty(&net->nft.notify_list));
>  }
>  
> +static int nf_tables_commit_audit_alloc(struct list_head *adl,
> +				 struct nft_table *table)
> +{
> +	struct nft_audit_data *adp;
> +
> +	list_for_each_entry(adp, adl, list) {
> +		if (adp->table == table)
> +			return 0;
> +	}
> +	adp = kzalloc(sizeof(*adp), GFP_KERNEL);
> +	if (!adp)
> +		return -ENOMEM;
> +	adp->table = table;
> +	INIT_LIST_HEAD(&adp->list);

This INIT_LIST_HEAD is not required for an object that is going to be
inserted into the 'adl' list.

> +	list_add(&adp->list, adl);

If no objections, I'll amend this patch. I'll include the UAF fix and
remove this unnecessary INIT_LIST_HEAD.

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


  parent reply	other threads:[~2021-03-31 20:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 17:38 [PATCH v5] audit: log nftables configuration change events once per table Richard Guy Briggs
2021-03-29  0:50 ` Paul Moore
2021-03-30 22:53   ` Pablo Neira Ayuso
2021-03-31  0:50     ` Paul Moore
2021-03-31 20:22 ` Pablo Neira Ayuso
2021-03-31 20:53   ` Richard Guy Briggs
2021-03-31 20:56     ` Pablo Neira Ayuso
2021-03-31 20:46 ` Pablo Neira Ayuso [this message]
2021-03-31 20:55   ` Richard Guy Briggs
2021-04-01 13:24 ` Phil Sutter
2021-04-01 13:34   ` Richard Guy Briggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210331204635.GA4634@salvia \
    --to=pablo@netfilter.org \
    --cc=dan.carpenter@oracle.com \
    --cc=eparis@parisplace.org \
    --cc=fw@strlen.de \
    --cc=jones.desougi+netfilter@gmail.com \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=rgb@redhat.com \
    --cc=tgraf@infradead.org \
    --cc=twoerner@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).