From: Steffen Klassert <steffen.klassert@secunet.com>
To: Xin Xiong <xiongx18@fudan.edu.cn>
Cc: "Herbert Xu" <herbert@gondor.apana.org.au>,
"“David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"James Morris" <jmorris@namei.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
yuanxzhang@fudan.edu.cn, "Xin Tan" <tanxin.ctf@gmail.com>
Subject: Re: [PATCH] xfrm: fix refcount leak in __xfrm_policy_check()
Date: Fri, 29 Jul 2022 15:08:22 +0200 [thread overview]
Message-ID: <20220729130822.GC2602992@gauss3.secunet.de> (raw)
In-Reply-To: <20220724095557.4350-1-xiongx18@fudan.edu.cn>
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@fudan.edu.cn>
> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Applied, thanks a lot Xin!
prev parent reply other threads:[~2022-07-29 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-24 9:55 Xin Xiong
2022-07-29 13:08 ` Steffen Klassert [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=20220729130822.GC2602992@gauss3.secunet.de \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=jmorris@namei.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tanxin.ctf@gmail.com \
--cc=xiongx18@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
all inboxes | Powered by JetHome®