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_type": "Line", "id": "CVE-2025-39965-19ca58b9", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd8ae32e4e4652db55bce6b9c79267d8946765a9", "signature_version": "v1", "target": { "file": "net/xfrm/xfrm_state.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "186589993230559022417702568474695526648", "288395212914493735022642484445782465120", "83148223151962832127088592056944974500", "32894046745124291068309224719207581590", "116688463558816151387996843800417860325", "112770679393643728552295103544551105410", "278176258792242583925295583644832922974" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2025-39965-1f8e0022", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a78e55776522373c446f18d5002a8de4b09e6bf7", "signature_version": "v1", "target": { "function": "xfrm_alloc_spi", "file": "net/xfrm/xfrm_state.c" }, "digest": { "function_hash": "204696702811454039678638333660646540859", "length": 1281.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2025-39965-3e93cd5c", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9fcedabaae0096f712bbb4ccca6a8538af1cd1c8", "signature_version": "v1", "target": { "file": "net/xfrm/xfrm_state.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "186589993230559022417702568474695526648", "288395212914493735022642484445782465120", "83148223151962832127088592056944974500", "32894046745124291068309224719207581590", "116688463558816151387996843800417860325", "112770679393643728552295103544551105410", "278176258792242583925295583644832922974" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2025-39965-8a8258c7", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0baf92d0b1590b903c1f4ead75e61715e50e8146", "signature_version": "v1", "target": { "file": "net/xfrm/xfrm_state.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "186589993230559022417702568474695526648", "288395212914493735022642484445782465120", "83148223151962832127088592056944974500", "32894046745124291068309224719207581590", "116688463558816151387996843800417860325", "112770679393643728552295103544551105410", "278176258792242583925295583644832922974" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2025-39965-94aeae02", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9fcedabaae0096f712bbb4ccca6a8538af1cd1c8", "signature_version": "v1", "target": { "function": "xfrm_alloc_spi", "file": "net/xfrm/xfrm_state.c" }, "digest": { "function_hash": "204696702811454039678638333660646540859", "length": 1281.0 }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2025-39965-aedb1dbd", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0baf92d0b1590b903c1f4ead75e61715e50e8146", "signature_version": "v1", "target": { "function": "xfrm_alloc_spi", "file": "net/xfrm/xfrm_state.c" }, "digest": { "function_hash": "204696702811454039678638333660646540859", "length": 1281.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2025-39965-e7269292", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a78e55776522373c446f18d5002a8de4b09e6bf7", "signature_version": "v1", "target": { "file": "net/xfrm/xfrm_state.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "186589993230559022417702568474695526648", "288395212914493735022642484445782465120", "83148223151962832127088592056944974500", "32894046745124291068309224719207581590", "116688463558816151387996843800417860325", "112770679393643728552295103544551105410", "278176258792242583925295583644832922974" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2025-39965-f9aef522", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cd8ae32e4e4652db55bce6b9c79267d8946765a9", "signature_version": "v1", "target": { "function": "xfrm_alloc_spi", "file": "net/xfrm/xfrm_state.c" }, "digest": { "function_hash": "204696702811454039678638333660646540859", "length": 1281.0 }, "deprecated": false } ]