netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Ido Schimmel <idosch@nvidia.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, amcohen@nvidia.com
Subject: Re: [PATCH net 1/3] netdevsim: fib: Fix reference count leak on route deletion failure
Date: Thu, 28 Jul 2022 09:21:38 -0600	[thread overview]
Message-ID: <a5c5e336-78dd-22ea-4641-d4e5f91cd241@gmail.com> (raw)
In-Reply-To: <20220728114535.3318119-2-idosch@nvidia.com>

On 7/28/22 5:45 AM, Ido Schimmel wrote:
> As part of FIB offload simulation, netdevsim stores IPv4 and IPv6 routes
> and holds a reference on FIB info structures that in turn hold a
> reference on the associated nexthop device(s).
> 
> In the unlikely case where we are unable to allocate memory to process a
> route deletion request, netdevsim will not release the reference from
> the associated FIB info structure, thereby preventing the associated
> nexthop device(s) from ever being removed [1].
> 
> Fix this by scheduling a work item that will flush netdevsim's FIB table
> upon route deletion failure. This will cause netdevsim to release its
> reference from all the FIB info structures in its table.
> 
> Reported by Lucas Leong of Trend Micro Zero Day Initiative.
> 
> Fixes: 0ae3eb7b4611 ("netdevsim: fib: Perform the route programming in a non-atomic context")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Amit Cohen <amcohen@nvidia.com>
> ---
> No "Reported-by" tag since I do not have the mail address of the
> reporter.
> ---
>  drivers/net/netdevsim/fib.c | 27 ++++++++++++++++++++++++++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



  reply	other threads:[~2022-07-28 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 11:45 [PATCH net 0/3] netdevsim: fib: Fix reference count leak on route deletion failure Ido Schimmel
2022-07-28 11:45 ` [PATCH net 1/3] " Ido Schimmel
2022-07-28 15:21   ` David Ahern [this message]
2022-07-28 11:45 ` [PATCH net 2/3] netdevsim: fib: Add debugfs knob to simulate " Ido Schimmel
2022-07-28 14:51   ` David Ahern
2022-07-28 11:45 ` [PATCH net 3/3] selftests: netdevsim: Add test cases for " Ido Schimmel
2022-07-28 14:53   ` David Ahern
2022-07-29  5:07 ` [PATCH net 0/3] netdevsim: fib: Fix reference count leak on " Jakub Kicinski
2022-07-29 11:30 ` patchwork-bot+netdevbpf

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=a5c5e336-78dd-22ea-4641-d4e5f91cd241@gmail.com \
    --to=dsahern@gmail.com \
    --cc=amcohen@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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).