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: <20250416190247.2820-1-kuniyu@amazon.com>
Date: Wed, 16 Apr 2025 12:02:45 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <pabeni@...hat.com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
	<horms@...nel.org>, <kuba@...nel.org>, <kuni1840@...il.com>,
	<kuniyu@...zon.com>, <netdev@...r.kernel.org>
Subject: Re: [PATCH RESEND v2 net-next 13/14] ipv6: Protect nh->f6i_list with spinlock and flag.

From: Paolo Abeni <pabeni@...hat.com>
Date: Wed, 16 Apr 2025 17:17:13 +0200
> On 4/14/25 8:15 PM, Kuniyuki Iwashima wrote:
> > @@ -1498,7 +1504,23 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt,
> >  	}
> >  #endif
> >  
> > -	err = fib6_add_rt2node(fn, rt, info, extack, &purge_list);
> > +	if (rt->nh) {
> > +		spin_lock(&rt->nh->lock);
> > +
> > +		if (rt->nh->dead) {
> > +			NL_SET_ERR_MSG(extack, "Nexthop has been deleted");
> > +			err = -EINVAL;
> > +		} else {
> > +			err = fib6_add_rt2node(fn, rt, info, extack, &purge_list);
> > +			if (!err)
> > +				list_add(&rt->nh_list, &rt->nh->f6i_list);
> > +		}
> 
> Maybe move the new check and list_add inside fib6_add_rt2node() or
> bundle all the above in a new helper?

fib6_add_rt2node() has return in many places, so a new hepler makes
more sense to me.

Will add fib6_add_rt2node_nh() and move spin_lock() section there.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ