netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dsahern@gmail.com
Cc: idosch@idosch.org, netdev@vger.kernel.org, alexpe@mellanox.com,
	mlxsw@mellanox.com, idosch@mellanox.com
Subject: Re: [PATCH net] ipv6: Unlink sibling route in case of failure
Date: Thu, 18 Jul 2019 12:03:01 -0700 (PDT)	[thread overview]
Message-ID: <20190718.120301.1523874454003539281.davem@davemloft.net> (raw)
In-Reply-To: <f6dacc3e-7b20-2441-dd7d-99d3983bddc3@gmail.com>

From: David Ahern <dsahern@gmail.com>
Date: Thu, 18 Jul 2019 08:21:01 -0600

> On 7/17/19 2:39 PM, Ido Schimmel wrote:
>> From: Ido Schimmel <idosch@mellanox.com>
>> 
>> When a route needs to be appended to an existing multipath route,
>> fib6_add_rt2node() first appends it to the siblings list and increments
>> the number of sibling routes on each sibling.
>> 
>> Later, the function notifies the route via call_fib6_entry_notifiers().
>> In case the notification is vetoed, the route is not unlinked from the
>> siblings list, which can result in a use-after-free.
>> 
>> Fix this by unlinking the route from the siblings list before returning
>> an error.
>> 
>> Audited the rest of the call sites from which the FIB notification chain
>> is called and could not find more problems.
>> 
>> Fixes: 2233000cba40 ("net/ipv6: Move call_fib6_entry_notifiers up for route adds")
>> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
>> Reported-by: Alexander Petrovskiy <alexpe@mellanox.com>
>> ---
>> Dave, this will not apply cleanly to stable trees due to recent changes
>> in net-next. I can prepare another patch for stable if needed.
>> ---
>>  net/ipv6/ip6_fib.c | 18 +++++++++++++++++-
>>  1 file changed, 17 insertions(+), 1 deletion(-)
>> 
> 
> Thanks for the fix, Ido. I can help with the ports as well.
> 
> Reviewed-by: David Ahern <dsahern@gmail.com>

Applied and queued up for -stable.

Since I've done a bunch of ipv6 routing fix backports through David's
refactoring and cleanups, I'll give this one a try too :-) If I run
into problems I'll ask for help.

Thanks.

      reply	other threads:[~2019-07-18 19:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-17 20:39 [PATCH net] ipv6: Unlink sibling route in case of failure Ido Schimmel
2019-07-18 14:21 ` David Ahern
2019-07-18 19:03   ` David Miller [this message]

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=20190718.120301.1523874454003539281.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=alexpe@mellanox.com \
    --cc=dsahern@gmail.com \
    --cc=idosch@idosch.org \
    --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).