From: Steffen Klassert <steffen.klassert@secunet.com>
To: Kotlyarov Mihail <mihailkotlyarow@gmail.com>
Cc: <netdev@vger.kernel.org>, <lvc-project@linuxtesting.org>,
<herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<horms@kernel.org>, <fw@strlen.de>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH ipsec] xfrm: fix refcount leak in xfrm_migrate_policy_find
Date: Wed, 8 Apr 2026 11:29:05 +0200 [thread overview]
Message-ID: <adYf4dQERmCeO0da@secunet.com> (raw)
In-Reply-To: <20260404090525.105083-1-mihailkotlyarow@gmail.com>
On Sat, Apr 04, 2026 at 12:05:20PM +0300, Kotlyarov Mihail wrote:
> syzkaller reported a memory leak in xfrm_policy_alloc:
>
> BUG: memory leak
> unreferenced object 0xffff888114d79000 (size 1024):
> comm "syz.1.17", pid 931
> ...
> xfrm_policy_alloc+0xb3/0x4b0 net/xfrm/xfrm_policy.c:432
>
> The root cause is a double call to xfrm_pol_hold_rcu() in
> xfrm_migrate_policy_find(). The lookup function already returns
> a policy with held reference, making the second call redundant.
>
> Remove the redundant xfrm_pol_hold_rcu() call to fix the refcount
> imbalance and prevent the memory leak.
>
> Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
>
> Fixes: 563d5ca93e88 ("xfrm: switch migrate to xfrm_policy_lookup_bytype")
> Signed-off-by: Kotlyarov Mihail <mihailkotlyarow@gmail.com>
Applied, thanks a lot!
prev parent reply other threads:[~2026-04-08 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-04 9:05 [PATCH ipsec] xfrm: fix refcount leak in xfrm_migrate_policy_find Kotlyarov Mihail
2026-04-04 9:33 ` Florian Westphal
2026-04-08 9:29 ` 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=adYf4dQERmCeO0da@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mihailkotlyarow@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.