In the Linux kernel, the following vulnerability has been resolved:
habanalabs: fix UAF in export_dmabuf()
As soon as we'd inserted a file reference into descriptor table, another thread could close it. That's fine for the case when all we are doing is returning that descriptor to userland (it's a race, but it's a userland race and there's nothing the kernel can do about it). However, if we follow fd_install() with any kind of access to objects that would be destroyed on close (be it the struct file itself or anything destroyed by its ->release()), we have a UAF.
dmabuffd() is a combination of reserving a descriptor and fdinstall(). habanalabs exportdmabuf() calls it and then proceeds to access the objects destroyed on close. In particular, it grabs an extra reference to another struct file that will be dropped as part of ->release() for ours; that "will be" is actually "might have already been".
Fix that by reserving descriptor before anything else and do fdinstall() only when everything had been set up. As a side benefit, we no longer have the failure exit with file already created, but reference to underlying file (as well as ->dmabufexportcnt, etc.) not grabbed yet; unlike dmabuffd(), fdinstall() can't fail.
[
{
"id": "CVE-2025-38722-0b22c223",
"target": {
"file": "drivers/accel/habanalabs/common/memory.c"
},
"digest": {
"line_hashes": [
"9235704723468020853730633995792363267",
"32261742202642970195797360177451423394",
"135106881644761277683027873569510591671",
"16199608835617933110572149363415487899",
"297853301258752924118123806315934439484",
"17384225103178876723089411602539968585",
"99026261802643988565546186901624759125",
"248336481992726435095773162267004316402",
"223367191924362721230002031532433096054",
"1740321500359393431432639019816322367",
"70816145036941332884554453691231267291",
"265823431449404714868882720144041018103",
"104097496258944612956542074299520477663",
"158258015929273094493608044845551323679",
"103176325616755452210081395573630261149",
"178169607011064115176497049351138625639",
"241335643824131732618886044792642172545",
"300369858339691898851357544928019892402",
"73028402307831516935288352965165355518",
"239417582085874113503168339911621861695",
"161368927209103400566686276527564454085",
"8330112538112512897043093223405459282",
"235748697550099977495509666880659260078",
"193184620861635155465255297327488237316",
"314848144088011921885521032405862989405",
"323151965802455014180249170688056881909",
"284556199475474128016821522634896809808"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@33927f3d0ecdcff06326d6e4edb6166aed42811c",
"signature_type": "Line"
},
{
"id": "CVE-2025-38722-294a4bb5",
"target": {
"function": "export_dmabuf",
"file": "drivers/accel/habanalabs/common/memory.c"
},
"digest": {
"length": 941.0,
"function_hash": "312928985776265309560125459857506364550"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@33927f3d0ecdcff06326d6e4edb6166aed42811c",
"signature_type": "Function"
},
{
"id": "CVE-2025-38722-4f029c20",
"target": {
"function": "hl_release_dmabuf",
"file": "drivers/accel/habanalabs/common/memory.c"
},
"digest": {
"length": 335.0,
"function_hash": "815516452689154539336475094714254564"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@40deceb38f9db759772d1c289c28fd2a543f57fc",
"signature_type": "Function"
},
{
"id": "CVE-2025-38722-7888ca6d",
"target": {
"function": "export_dmabuf",
"file": "drivers/accel/habanalabs/common/memory.c"
},
"digest": {
"length": 941.0,
"function_hash": "312928985776265309560125459857506364550"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@40deceb38f9db759772d1c289c28fd2a543f57fc",
"signature_type": "Function"
},
{
"id": "CVE-2025-38722-bfff10fb",
"target": {
"function": "hl_release_dmabuf",
"file": "drivers/accel/habanalabs/common/memory.c"
},
"digest": {
"length": 335.0,
"function_hash": "815516452689154539336475094714254564"
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@33927f3d0ecdcff06326d6e4edb6166aed42811c",
"signature_type": "Function"
},
{
"id": "CVE-2025-38722-ee32494a",
"target": {
"file": "drivers/accel/habanalabs/common/memory.c"
},
"digest": {
"line_hashes": [
"9235704723468020853730633995792363267",
"32261742202642970195797360177451423394",
"135106881644761277683027873569510591671",
"16199608835617933110572149363415487899",
"297853301258752924118123806315934439484",
"17384225103178876723089411602539968585",
"99026261802643988565546186901624759125",
"248336481992726435095773162267004316402",
"223367191924362721230002031532433096054",
"1740321500359393431432639019816322367",
"70816145036941332884554453691231267291",
"265823431449404714868882720144041018103",
"104097496258944612956542074299520477663",
"158258015929273094493608044845551323679",
"103176325616755452210081395573630261149",
"178169607011064115176497049351138625639",
"241335643824131732618886044792642172545",
"300369858339691898851357544928019892402",
"73028402307831516935288352965165355518",
"239417582085874113503168339911621861695",
"161368927209103400566686276527564454085",
"8330112538112512897043093223405459282",
"235748697550099977495509666880659260078",
"193184620861635155465255297327488237316",
"314848144088011921885521032405862989405",
"323151965802455014180249170688056881909",
"284556199475474128016821522634896809808"
],
"threshold": 0.9
},
"signature_version": "v1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@40deceb38f9db759772d1c289c28fd2a543f57fc",
"signature_type": "Line"
}
]