[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6844758.PSh0Y5hloC@bentobox>
Date: Mon, 20 Apr 2020 07:53:31 +0200
From: Sven Eckelmann <sven@...fation.org>
To: Xiyu Yang <xiyuyang19@...an.edu.cn>
Cc: Marek Lindner <mareklindner@...mailbox.ch>,
Simon Wunderlich <sw@...onwunderlich.de>,
Antonio Quartulli <a@...table.cc>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, yuanxzhang@...an.edu.cn,
kjlu@....edu, Xin Tan <tanxin.ctf@...il.com>
Subject: Re: [PATCH] batman-adv: Fix refcnt leak in batadv_v_ogm_process
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@...an.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@...il.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
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists