OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] various dst_ifdown routines to catch refcounting bugs
Re: [PATCH] various dst_ifdown routines to catch refcounting bugs [message #20904 is a reply to message #20898] Thu, 27 September 2007 16:27 Go to previous messageGo to previous message
ebiederm is currently offline  ebiederm
Messages: 1354
Registered: February 2006
Senior Member
"Denis V. Lunev" <den@openvz.org> writes:

> Moving dst entries into init_net.loopback_dev is not a good thing.
> This hides obvious and non-obvious ref-counting bugs.

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

To be clear using init_net.loopback is currently safe because we don't
have any destination cache entries for anything except the initial
network namespace.

I have not yet made this change simply because I haven't gotten around
to this part in my patches.

I do have a question I would like to bring up, because I like avoiding
explicit references to loopback_dev when I can.

/* Dirty hack. We did it in 2.2 (in __dst_free),
 * we have _very_ good reasons not to repeat
 * this mistake in 2.3, but we have no choice
 * now. _It_ _is_ _explicit_ _deliberate_
 * _race_ _condition_.
 *
 * Commented and originally written by Alexey.
 */

What is the race that is talked about in that comment.  Can we just
assign NULL instead of the loopback device when we bring a route down.
My gut feeling is that something like:
	dst->input = dst->output = dst_discard;
may be enough.    But I don't know where the deliberate race is.

I haven't traced this all of the way through but from the obvious
parts I just get this nagging feeling that something isn't quite
right.

Eric
 
Read Message
Read Message
Read Message
Previous Topic: [PATCH] proper comment for loopback initialization order
Next Topic: [PATCH 1/4] net: Dynamically allocate the per cpu counters for the loopback device.
Goto Forum:
  


Current Time: Wed Oct 08 06:44:33 GMT 2025

Total time taken to generate the page: 0.08276 seconds