From: David Miller <davem@davemloft.net>
To: xiyuyang19@fudan.edu.cn
Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
tanxin.ctf@gmail.com
Subject: Re: [PATCH] ipv6: Fix nexthop refcnt leak when creating ipv6 route info
Date: Tue, 28 Jul 2020 17:24:47 -0700 (PDT) [thread overview]
Message-ID: <20200728.172447.1925120854282970312.davem@davemloft.net> (raw)
In-Reply-To: <1595664139-40703-1-git-send-email-xiyuyang19@fudan.edu.cn>
From: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Date: Sat, 25 Jul 2020 16:02:18 +0800
> ip6_route_info_create() invokes nexthop_get(), which increases the
> refcount of the "nh".
>
> When ip6_route_info_create() returns, local variable "nh" becomes
> invalid, so the refcount should be decreased to keep refcount balanced.
>
> The reference counting issue happens in one exception handling path of
> ip6_route_info_create(). When nexthops can not be used with source
> routing, the function forgets to decrease the refcnt increased by
> nexthop_get(), causing a refcnt leak.
>
> Fix this issue by pulling up the error source routing handling when
> nexthops can not be used with source routing.
>
> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2020-07-29 0:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-25 8:02 [PATCH] ipv6: Fix nexthop refcnt leak when creating ipv6 route info Xiyu Yang
2020-07-26 0:07 ` David Ahern
2020-07-29 0:24 ` 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=20200728.172447.1925120854282970312.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tanxin.ctf@gmail.com \
--cc=xiyuyang19@fudan.edu.cn \
--cc=yoshfuji@linux-ipv6.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).