From: Sven Eckelmann <sven@narfation.org>
To: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Cc: Marek Lindner <mareklindner@neomailbox.ch>,
Simon Wunderlich <sw@simonwunderlich.de>,
Antonio Quartulli <a@unstable.cc>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, yuanxzhang@fudan.edu.cn,
kjlu@umn.edu, Xin Tan <tanxin.ctf@gmail.com>
Subject: Re: [PATCH] batman-adv: Fix refcnt leak in batadv_v_ogm_process
Date: Mon, 20 Apr 2020 07:53:31 +0200 [thread overview]
Message-ID: <6844758.PSh0Y5hloC@bentobox> (raw)
In-Reply-To: <1587361040-83099-1-git-send-email-xiyuyang19@fudan.edu.cn>
[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]
On Monday, 20 April 2020 07:37:20 CEST Xiyu Yang wrote:
> batadv_v_ogm_process() invokes batadv_hardif_neigh_get(), which returns
> a reference of the neighbor object to "hardif_neigh" with increased
> refcount.
>
> When batadv_v_ogm_process() returns, "hardif_neigh" becomes invalid, so
> the refcount should be decreased to keep refcount balanced.
>
> The reference counting issue happens in one exception handling paths of
> batadv_v_ogm_process(). When batadv_v_ogm_orig_get() fails to get the
> orig node and returns NULL, the refcnt increased by
> batadv_hardif_neigh_get() is not decreased, causing a refcnt leak.
>
> Fix this issue by jumping to "out" label when batadv_v_ogm_orig_get()
> fails to get the orig node.
>
> Fixes: 9323158ef9f4 ("batman-adv: OGMv2 - implement originators logic")
> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
> ---
> net/batman-adv/bat_v_ogm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied [1]
Thanks,
Sven
[1] https://git.open-mesh.org/linux-merge.git/commit/afba933d9875cdf31c973a1ecf05de7129a142c4
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2020-04-20 5:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-20 5:37 [PATCH] batman-adv: Fix refcnt leak in batadv_v_ogm_process Xiyu Yang
2020-04-20 5:53 ` Sven Eckelmann [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=6844758.PSh0Y5hloC@bentobox \
--to=sven@narfation.org \
--cc=a@unstable.cc \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=kjlu@umn.edu \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mareklindner@neomailbox.ch \
--cc=netdev@vger.kernel.org \
--cc=sw@simonwunderlich.de \
--cc=tanxin.ctf@gmail.com \
--cc=xiyuyang19@fudan.edu.cn \
--cc=yuanxzhang@fudan.edu.cn \
/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