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] [day] [month] [year] [list]
Message-ID: <CANn89iKsTeDtiPQjLPYew_GodSG6JiQ+WNH-MrVrxRVj4CcOYA@mail.gmail.com>
Date: Mon, 20 May 2024 17:34:02 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, 
	Jakub Kicinski <kuba@...nel.org>, David Ahern <dsahern@...nel.org>, 
	Sabrina Dubroca <sd@...asysnail.net>
Subject: Re: [RFC PATCH] net: flush dst_cache on device removal

On Mon, May 20, 2024 at 5:30 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On Mon, 2024-05-20 at 15:54 +0200, Eric Dumazet wrote:
> > On Mon, May 20, 2024 at 1:00 PM Paolo Abeni <pabeni@...hat.com> wrote:
> > >
> > > Eric reported that dst_cache don't cope correctly with device removal,
> > > keeping the cached dst unmodified even when the underlining device is
> > > deleted and the dst itself is not uncached.
> > >
> > > The above causes the infamous 'unregistering netdevice' hangup.
> > >
> > > Address the issue implementing explicit book-keeping of all the
> > > initialized dst_caches. At network device unregistration time, traverse
> > > them, looking for relevant dst and eventually replace the dst reference
> > > with a blackhole one.
> > >
> > > Use an xarray to store the dst_cache references, to avoid blocking the
> > > BH during the traversal for a possibly unbounded time.
> > >
> > > Reported-by: Eric Dumazet <edumazet@...gle.com>
> > > Fixes: 911362c70df5 ("net: add dst_cache support")
> > > Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> > > ---
> > > I can't reproduce the issue locally, I hope somebody able to observe it
> > > could step-in and give this patch a shot.
> > > ---
> >
> > H Paolo, thanks for your patch.
> >
> > It seems dst_cache_netdev_event() could spend an awful amount of cpu
> > in complex setups.
>
> I agree.
>
> > I wonder if we could instead reuse the existing uncached_list
> > mechanism we have already ?
>
> Then rt_flush_dev()/fib_netdev_event() will use a similar amount of
> time, right? Or do you mean something entirely different?
>
> On the plus side it will make this patch much smaller, dropping the
> notifier.
>
> > BTW it seems we could get rid of the ul->quarantine lists.
>
> I think 'quarantine' is used to avoid traversing multiple times the
> same/already blackholed entries when processing multiple
> NETDEV_UNREGISTER events before the dst entries themself are freed.

But if we list_del_init(&rt->dst.rt_uncached), each handled dst is not anymore
in a list.

ul->quarantine has no purpose (we never traverse it). Even kmemleak
does not need it, I think.

Note this is net-next material, just because I took a look after
seeing your patch.

> Could it make a difference at netns disposal time with many dst and
> devices in there?
>
> Cheers,
>
> Paolo
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ