CVE-2025-39817

Source
https://cve.org/CVERecord?id=CVE-2025-39817
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-39817.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-39817
Downstream
Related
Published
2025-09-16T13:00:17.776Z
Modified
2026-05-15T11:53:35.764101035Z
Summary
efivarfs: Fix slab-out-of-bounds in efivarfs_d_compare
Details

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 efivarfsd_compare+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 __arm64sysopenat+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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39817.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.9.0
Fixed
5.4.298
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.242
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.191
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.150
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.104
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.45
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.16.5

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-39817.json"