[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a5c5e336-78dd-22ea-4641-d4e5f91cd241@gmail.com>
Date: Thu, 28 Jul 2022 09:21:38 -0600
From: David Ahern <dsahern@...il.com>
To: Ido Schimmel <idosch@...dia.com>, netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, amcohen@...dia.com
Subject: Re: [PATCH net 1/3] netdevsim: fib: Fix reference count leak on route
deletion failure
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@...dia.com>
> Reviewed-by: Amit Cohen <amcohen@...dia.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@...nel.org>
Powered by blists - more mailing lists