lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210331205538.GJ3112383@madcap2.tricolour.ca>
Date:   Wed, 31 Mar 2021 16:55:38 -0400
From:   Richard Guy Briggs <rgb@...hat.com>
To:     Pablo Neira Ayuso <pablo@...filter.org>
Cc:     Linux-Audit Mailing List <linux-audit@...hat.com>,
        LKML <linux-kernel@...r.kernel.org>,
        netfilter-devel@...r.kernel.org, Paul Moore <paul@...l-moore.com>,
        Eric Paris <eparis@...isplace.org>,
        Steve Grubb <sgrubb@...hat.com>,
        Florian Westphal <fw@...len.de>, Phil Sutter <phil@....cc>,
        twoerner@...hat.com, tgraf@...radead.org, dan.carpenter@...cle.com,
        Jones Desougi <jones.desougi+netfilter@...il.com>
Subject: Re: [PATCH v5] audit: log nftables configuration change events once
 per table

On 2021-03-31 22:46, Pablo Neira Ayuso wrote:
> 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.

Ok, so it is harmless other than being code noise and overhead, thanks again.

- RGB

--
Richard Guy Briggs <rgb@...hat.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ