In the Linux kernel, the following vulnerability has been resolved:
efivarfs: Fix slab-out-of-bounds in efivarfsdcompare
Observed on kernel 6.6 (present on master as well):
BUG: KASAN: slab-out-of-bounds in memcmp+0x98/0xd0 Call trace: kasancheckrange+0xe8/0x190 _asanloadN+0x1c/0x28 memcmp+0x98/0xd0 efivarfsdcompare+0x68/0xd8 _dlookuprcuopcompare+0x178/0x218 _dlookuprcu+0x1f8/0x228 dallocparallel+0x150/0x648 lookupopen.isra.0+0x5f0/0x8d0 openlastlookups+0x264/0x828 pathopenat+0x130/0x3f8 dofilpopen+0x114/0x248 dosysopenat2+0x340/0x3c0 _arm64sys_openat+0x120/0x1a0
If dentry->dname.len < EFIVARIABLEGUIDLEN , 'guid' can become negative, leadings to oob. The issue can be triggered by parallel lookups using invalid filename:
T1 T2 lookupopen ->lookup simplelookup d_add // invalid dentry is added to hash list
lookup_open
d_alloc_parallel
__d_lookup_rcu
__d_lookup_rcu_op_compare
hlist_bl_for_each_entry_rcu
// invalid dentry can be retrieved
->d_compare
efivarfs_d_compare
// oob
Fix it by checking 'guid' before cmp.
[
{
"deprecated": false,
"id": "CVE-2025-39817-0a717ca7",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2925cd6207079c3f4d040d082515db78d63afbf",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-0b877147",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a6358f8cf64850f3f27857b8ed8c1b08cfc4685c",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-20b3d2e7",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d7f5e35e70507d10cbaff5f9e194ed54c4ee14f7",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-3083c573",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f63fbabeaaaaaaf5b742a2f4c1b4590d50bf1f6",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-31a6962b",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@794399019301944fd6d2e0d7a51b3327e26c410e",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-3efebfcb",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@71581a82f38e5a4d807d71fc1bb59aead80ccf95",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-4245af90",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f63fbabeaaaaaaf5b742a2f4c1b4590d50bf1f6",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-5b218b80",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2925cd6207079c3f4d040d082515db78d63afbf",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-63410b07",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@71581a82f38e5a4d807d71fc1bb59aead80ccf95",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-666a41ff",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@794399019301944fd6d2e0d7a51b3327e26c410e",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-6d8890cf",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@925599eba46045930b850a98ae594d2e3028ac40",
"target": {
"file": "fs/efivarfs/super.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"25661061957670922700817172213518378432",
"215012292541060890485518037034217411221",
"182559057387798330901817793522735977248"
]
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-7d4443a3",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a6358f8cf64850f3f27857b8ed8c1b08cfc4685c",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-d3a6b10e",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d7f5e35e70507d10cbaff5f9e194ed54c4ee14f7",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
},
{
"deprecated": false,
"id": "CVE-2025-39817-d6f718e7",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@925599eba46045930b850a98ae594d2e3028ac40",
"target": {
"file": "fs/efivarfs/super.c",
"function": "efivarfs_d_compare"
},
"digest": {
"function_hash": "37409464469495466075476787072932048611",
"length": 343.0
}
}
]