[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220729130822.GC2602992@gauss3.secunet.de>
Date: Fri, 29 Jul 2022 15:08:22 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Xin Xiong <xiongx18@...an.edu.cn>
CC: Herbert Xu <herbert@...dor.apana.org.au>,
"“David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
"Jakub Kicinski" <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
James Morris <jmorris@...ei.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <yuanxzhang@...an.edu.cn>,
Xin Tan <tanxin.ctf@...il.com>
Subject: Re: [PATCH] xfrm: fix refcount leak in __xfrm_policy_check()
On Sun, Jul 24, 2022 at 05:55:58PM +0800, Xin Xiong wrote:
> The issue happens on an error path in __xfrm_policy_check(). When the
> fetching process of the object `pols[1]` fails, the function simply
> returns 0, forgetting to decrement the reference count of `pols[0]`,
> which is incremented earlier by either xfrm_sk_policy_lookup() or
> xfrm_policy_lookup(). This may result in memory leaks.
>
> Fix it by decreasing the reference count of `pols[0]` in that path.
>
> Fixes: 134b0fc544ba ("IPsec: propagate security module errors up from flow_cache_lookup")
> Signed-off-by: Xin Xiong <xiongx18@...an.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@...il.com>
Applied, thanks a lot Xin!
Powered by blists - more mailing lists