netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Ido Schimmel <idosch@mellanox.com>,
	Netdev <netdev@vger.kernel.org>,
	"Duyck, Alexander H" <alexander.h.duyck@intel.com>,
	Fengguang Wu <fengguang.wu@intel.com>,
	David Ahern <dsahern@gmail.com>,
	mlxsw@mellanox.com
Subject: Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables
Date: Tue, 19 Dec 2017 20:49:13 +0200	[thread overview]
Message-ID: <20171219184913.GA18980@splinter> (raw)
In-Reply-To: <CAKgT0UfnK9ueT3PtD=HKB2f_XhccoVq6HnnQ=vRgEdtM-WUG2Q@mail.gmail.com>

On Tue, Dec 19, 2017 at 09:34:16AM -0800, Alexander Duyck wrote:
> That seems like unneeded complexity when the issue is just the order
> that these were created in versus the order they are freed in. As long
> as we always destroy the one containing the alias before the one that
> has the actual data we don't need to have a reference count. Basically
> the issue is the bring-up and the tear-down order. It isn't something
> that really needs a reference count since it would always be either 1
> or 2. My preference would be to just add a comment explaining that
> local must always be destroyed before the main trie in order to
> guarantee that there are no external references to the data contained
> in main when it is freed.
> 
> The one question I have in all this is if I did the bring-up in the
> right order in the first place. I'm wondering if local should be where
> the combined trie lives instead of main. Local is currently destroyed
> after main anyway so I wonder if it wouldn't have been better if
> everything lived in local since from what I can tell it looks like we
> add rules for local first before we do so in main. The complexity of
> that patch would be higher though since the patch would need to be
> much larger and touch multiple files.

I decided to go with the original patch because it resulted in a very
small diff (patch is needed in -stable as well), but I agree with Dave
about it not being explicit enough.

How about I'll send v2 with a comment and then we can try Alex's
suggestion in net-next?

Thanks

  reply	other threads:[~2017-12-19 18:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  8:13 [PATCH net] ipv4: Fix use-after-free when flushing FIB tables Ido Schimmel
2017-12-19 16:32 ` David Miller
2017-12-19 17:34   ` Alexander Duyck
2017-12-19 18:49     ` Ido Schimmel [this message]
2017-12-19 19:01       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171219184913.GA18980@splinter \
    --to=idosch@idosch.org \
    --cc=alexander.duyck@gmail.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=idosch@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).