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: <20241021194048.88666-1-kuniyu@amazon.com>
Date: Mon, 21 Oct 2024 12:40:48 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <gnaaman@...venets.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<kuniyu@...zon.com>, <netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH net-next v6 1/6] neighbour: Add hlist_node to struct neighbour

From: Gilad Naaman <gnaaman@...venets.com>
Date: Mon, 21 Oct 2024 19:36:22 +0000
> > > @@ -530,27 +532,47 @@ static void neigh_get_hash_rnd(u32 *x)
> > >  
> > >  static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift)
> > >  {
> > > +	size_t hash_heads_size = (1 << shift) * sizeof(struct hlist_head);
> > >  	size_t size = (1 << shift) * sizeof(struct neighbour *);
> > > -	struct neigh_hash_table *ret;
> > >  	struct neighbour __rcu **buckets;
> > > +	struct hlist_head *hash_heads;
> > > +	struct neigh_hash_table *ret;
> > >  	int i;
> > >  
> > > +	hash_heads = NULL;
> > 
> > nit: This init is not needed.
> 
> This is needed in order to prevent unitialized memory access if we failed to
> allocate `buckets`.

Ah, you are right.

> 
> If possible I'd prefer to leave this as-is, given that this is rewritten later,
> in commit 5.

Sounds good.  Let's remove that in patch 5.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ