From: Simon Horman <horms@kernel.org>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org, Aakash Kumar S <saakashkumar@marvell.com>,
steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
syzbot+a25ee9d20d31e483ba7b@syzkaller.appspotmail.com
Subject: Re: [PATCH ipsec] xfrm: xfrm_alloc_spi shouldn't use 0 as SPI
Date: Fri, 29 Aug 2025 14:49:31 +0100 [thread overview]
Message-ID: <20250829134931.GL31759@horms.kernel.org> (raw)
In-Reply-To: <b7a2832406b97f48fbfdffc93f00b7a3fd83fee1.1756457310.git.sd@queasysnail.net>
On Fri, Aug 29, 2025 at 10:54:15AM +0200, Sabrina Dubroca wrote:
> x->id.spi == 0 means "no SPI assigned", but since commit
> 94f39804d891 ("xfrm: Duplicate SPI Handling"), we now create states
> and add them to the byspi list with this value.
>
> __xfrm_state_delete doesn't remove those states from the byspi list,
> since they shouldn't be there, and this shows up as a UAF the next
> time we go through the byspi list.
>
> Reported-by: syzbot+a25ee9d20d31e483ba7b@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=a25ee9d20d31e483ba7b
> Fixes: 94f39804d891 ("xfrm: Duplicate SPI Handling")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Thanks, I see that prior to the cited commit an error would
be returned if newspi was 0. Where newspi was
assigned the value of get_random_u32_inclusive(low, high).
Reviewed-by: Simon Horman <horms@kernel.org>
...
next prev parent reply other threads:[~2025-08-29 13:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 8:54 [PATCH ipsec] xfrm: xfrm_alloc_spi shouldn't use 0 as SPI Sabrina Dubroca
2025-08-29 13:49 ` Simon Horman [this message]
2025-09-03 6:21 ` Steffen Klassert
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=20250829134931.GL31759@horms.kernel.org \
--to=horms@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=saakashkumar@marvell.com \
--cc=sd@queasysnail.net \
--cc=steffen.klassert@secunet.com \
--cc=syzbot+a25ee9d20d31e483ba7b@syzkaller.appspotmail.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.