From: Steffen Klassert <steffen.klassert@secunet.com>
To: "Nikola Z. Ivanov" <zlatistiv@gmail.com>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<horms@kernel.org>, <saakashkumar@marvell.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-kernel-mentees@lists.linux.dev>
Subject: Re: [PATCH net] net/xfrm: Refuse to allocate xfrm_state with SPI value 0
Date: Mon, 22 Sep 2025 09:08:14 +0200 [thread overview]
Message-ID: <aND13piG0NIlBt1U@secunet.com> (raw)
In-Reply-To: <20250921022701.530305-1-zlatistiv@gmail.com>
On Sun, Sep 21, 2025 at 05:27:01AM +0300, Nikola Z. Ivanov wrote:
> Reported by syzkaller: "KASAN: slab-use-after-free Read in xfrm_alloc_spi"
>
> Before commit 94f39804d891 ("xfrm: Duplicate SPI Handling")
> xfrm_alloc_spi would report spi=0 as unavailable.
> Add this behaviour back by adding 1 to the "low" value when it is passed as 0.
> Allocating xfrm_state with spi=0 leads to UAF or CPU stall.
>
> Fixes: 94f39804d891 ("xfrm: Duplicate SPI Handling")
> Signed-off-by: Nikola Z. Ivanov <zlatistiv@gmail.com>
This is already fixed in the ipsec tree by
commit cd8ae32e4e46 ("xfrm: xfrm_alloc_spi shouldn't use 0 as SPI")
Thanks a lot anyway!
prev parent reply other threads:[~2025-09-22 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-21 2:27 [PATCH net] net/xfrm: Refuse to allocate xfrm_state with SPI value 0 Nikola Z. Ivanov
2025-09-22 7: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=aND13piG0NIlBt1U@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=herbert@gondor.apana.org.au \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saakashkumar@marvell.com \
--cc=zlatistiv@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox