In the Linux kernel, the following vulnerability has been resolved:
xfrm: xfrmallocspi shouldn't use 0 as SPI
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.
_xfrmstate_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.
[
{
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2025-39965-1f8e0022",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a78e55776522373c446f18d5002a8de4b09e6bf7",
"digest": {
"function_hash": "204696702811454039678638333660646540859",
"length": 1281.0
},
"signature_type": "Function",
"target": {
"function": "xfrm_alloc_spi",
"file": "net/xfrm/xfrm_state.c"
}
},
{
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2025-39965-e7269292",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a78e55776522373c446f18d5002a8de4b09e6bf7",
"digest": {
"line_hashes": [
"186589993230559022417702568474695526648",
"288395212914493735022642484445782465120",
"83148223151962832127088592056944974500",
"32894046745124291068309224719207581590",
"116688463558816151387996843800417860325",
"112770679393643728552295103544551105410",
"278176258792242583925295583644832922974"
],
"threshold": 0.9
},
"signature_type": "Line",
"target": {
"file": "net/xfrm/xfrm_state.c"
}
}
]