[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <af65863b-5801-d97a-765d-f590d4895daa@cumulusnetworks.com>
Date: Thu, 15 Nov 2018 11:49:45 -0800
From: David Ahern <dsa@...ulusnetworks.com>
To: Xin Long <lucien.xin@...il.com>,
network dev <netdev@...r.kernel.org>
Cc: David Miller <davem@...emloft.net>,
Mika Penttilä <mika.penttila@...tfour.com>
Subject: Re: [PATCH net] ipv6: fix a dst leak when removing its exception
On 11/13/18 8:48 AM, Xin Long wrote:
> These is no need to hold dst before calling rt6_remove_exception_rt().
> The call to dst_hold_safe() in ip6_link_failure() was for ip6_del_rt(),
> which has been removed in Commit 93531c674315 ("net/ipv6: separate
> handling of FIB entries from dst based routes"). Otherwise, it will
> cause a dst leak.
>
> This patch is to simply remove the dst_hold_safe() call before calling
> rt6_remove_exception_rt() and also do the same in ip6_del_cached_rt().
> It's safe, because the removal of the exception that holds its dst's
> refcnt is protected by rt6_exception_lock.
>
> Fixes: 93531c674315 ("net/ipv6: separate handling of FIB entries from dst based routes")
> Fixes: 23fb93a4d3f1 ("net/ipv6: Cleanup exception and cache route handling")
> Reported-by: Li Shuang <shuali@...hat.com>
> Signed-off-by: Xin Long <lucien.xin@...il.com>
> ---
> net/ipv6/route.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
Ok, I see now. commit ad65a2f05695 add the dst_hold_safe with
ip6_del_rt. ip6_del_rt called ip6_rt_put to release the reference taken
by the hold_safe. Those paths are gone now.
Reviewed-by: David Ahern <dsahern@...il.com>
Powered by blists - more mailing lists