Linux Kernel up to 6.16.9 hugetlb folio_mapped reference count

| CVSS Meta Temp Score | Current Exploit Price (≈) | CTI Interest Score |
|---|---|---|
| 4.6 | $0-$5k | 0.00 |
Summary
A vulnerability has been found in Linux Kernel up to 6.16.9 and classified as critical. Impacted is the function folio_mapped of the component hugetlb. This manipulation causes reference count.
The identification of this vulnerability is CVE-2025-40006. There is no exploit available.
The affected component should be upgraded.
Details
A vulnerability classified as critical was found in Linux Kernel up to 6.16.9. Affected by this vulnerability is the function folio_mapped of the component hugetlb. The manipulation with an unknown input leads to a reference count vulnerability. The CWE definition for the vulnerability is CWE-911. The product uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count. As an impact it is known to affect availability. The summary by CVE is:
In the Linux kernel, the following vulnerability has been resolved: mm/hugetlb: fix folio is still mapped when deleted Migration may be raced with fallocating hole. remove_inode_single_folio will unmap the folio if the folio is still mapped. However, it's called without folio lock. If the folio is migrated and the mapped pte has been converted to migration entry, folio_mapped() returns false, and won't unmap it. Due to extra refcount held by remove_inode_single_folio, migration fails, restores migration entry to normal pte, and the folio is mapped again. As a result, we triggered BUG in filemap_unaccount_folio. The log is as follows: BUG: Bad page cache in process hugetlb pfn:156c00 page: refcount:515 mapcount:0 mapping:0000000099fef6e1 index:0x0 pfn:0x156c00 head: order:9 mapcount:1 entire_mapcount:1 nr_pages_mapped:0 pincount:0 aops:hugetlbfs_aops ino:dcc dentry name(?):"my_hugepage_file" flags: 0x17ffffc00000c1(locked|waiters|head|node=0|zone=2|lastcpupid=0x1fffff) page_type: f4(hugetlb) page dumped because: still mapped when deleted CPU: 1 UID: 0 PID: 395 Comm: hugetlb Not tainted 6.17.0-rc5-00044-g7aac71907bde-dirty #484 NONE Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015 Call Trace: dump_stack_lvl+0x4f/0x70 filemap_unaccount_folio+0xc4/0x1c0 __filemap_remove_folio+0x38/0x1c0 filemap_remove_folio+0x41/0xd0 remove_inode_hugepages+0x142/0x250 hugetlbfs_fallocate+0x471/0x5a0 vfs_fallocate+0x149/0x380 Hold folio lock before checking if the folio is mapped to avold race with migration.
It is possible to read the advisory at git.kernel.org. This vulnerability is known as CVE-2025-40006 since 04/16/2025. The exploitation appears to be difficult. Technical details of the vulnerability are known, but there is no available exploit.
The vulnerability scanner Nessus provides a plugin with the ID 271668 (Linux Distros Unpatched Vulnerability : CVE-2025-40006), which helps to determine the existence of the flaw in a target environment.
Upgrading to version 5.4.300, 5.10.245, 5.15.194, 6.1.155, 6.6.109, 6.12.50 or 6.16.10 eliminates this vulnerability. Applying the patch bc1c9ce8aeff45318332035dbef9713fb9e982d7/91f548e920fbf8be3f285bfa3fa045ae017e836d/3e851448078f5b01f6264915df3cfef75e323a12/c1dc0524ab2cc3982d4e0d2bfac71a0cd4d65c39/c9c2a51f91aea70e89b496cac360cd795a2b3c26/910d7749346c4b0acdc6e4adfdc4a9984281a206/21ee79ce938127f88fe07e409c1817f477dbe7ea/7b7387650dcf2881fd8bb55bcf3c8bd6c9542dd7 is able to eliminate this problem. The bugfix is ready for download at git.kernel.org. The best possible mitigation is suggested to be upgrading to the latest version.
The vulnerability is also documented in the databases at Tenable (271668) and CERT Bund (WID-SEC-2025-2350). Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Affected
- Debian Linux
- Ubuntu Linux
- SUSE Linux
- Oracle Linux
- SUSE openSUSE
- Open Source Linux Kernel
Product
Type
Vendor
Name
Version
- 5.4.299
- 5.10.244
- 5.15.193
- 6.1.154
- 6.6.108
- 6.12.0
- 6.12.1
- 6.12.2
- 6.12.3
- 6.12.4
- 6.12.5
- 6.12.6
- 6.12.7
- 6.12.8
- 6.12.9
- 6.12.10
- 6.12.11
- 6.12.12
- 6.12.13
- 6.12.14
- 6.12.15
- 6.12.16
- 6.12.17
- 6.12.18
- 6.12.19
- 6.12.20
- 6.12.21
- 6.12.22
- 6.12.23
- 6.12.24
- 6.12.25
- 6.12.26
- 6.12.27
- 6.12.28
- 6.12.29
- 6.12.30
- 6.12.31
- 6.12.32
- 6.12.33
- 6.12.34
- 6.12.35
- 6.12.36
- 6.12.37
- 6.12.38
- 6.12.39
- 6.12.40
- 6.12.41
- 6.12.42
- 6.12.43
- 6.12.44
- 6.12.45
- 6.12.46
- 6.12.47
- 6.12.48
- 6.12.49
- 6.16.0
- 6.16.1
- 6.16.2
- 6.16.3
- 6.16.4
- 6.16.5
- 6.16.6
- 6.16.7
- 6.16.8
- 6.16.9
License
Website
- Vendor: https://www.kernel.org/
CPE 2.3
CPE 2.2
CVSSv4
VulDB Vector: 🔒VulDB Reliability: 🔍
CVSSv3
VulDB Meta Base Score: 4.8VulDB Meta Temp Score: 4.6
VulDB Base Score: 4.8
VulDB Temp Score: 4.6
VulDB Vector: 🔒
VulDB Reliability: 🔍
CVSSv2
| AV | AC | Au | C | I | A |
|---|---|---|---|---|---|
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| 💳 | 💳 | 💳 | 💳 | 💳 | 💳 |
| Vector | Complexity | Authentication | Confidentiality | Integrity | Availability |
|---|---|---|---|---|---|
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
| Unlock | Unlock | Unlock | Unlock | Unlock | Unlock |
VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍
Exploiting
Class: Reference countCWE: CWE-911 / CWE-664
CAPEC: 🔒
ATT&CK: 🔒
Physical: No
Local: No
Remote: Partially
Availability: 🔒
Status: Not defined
EPSS Score: 🔒
EPSS Percentile: 🔒
Price Prediction: 🔍
Current Price Estimation: 🔒
| 0-Day | Unlock | Unlock | Unlock | Unlock |
|---|---|---|---|---|
| Today | Unlock | Unlock | Unlock | Unlock |
Nessus ID: 271668
Nessus Name: Linux Distros Unpatched Vulnerability : CVE-2025-40006
Threat Intelligence
Interest: 🔍Active Actors: 🔍
Active APT Groups: 🔍
Countermeasures
Recommended: UpgradeStatus: 🔍
0-Day Time: 🔒
Upgrade: Kernel 5.4.300/5.10.245/5.15.194/6.1.155/6.6.109/6.12.50/6.16.10
Patch: bc1c9ce8aeff45318332035dbef9713fb9e982d7/91f548e920fbf8be3f285bfa3fa045ae017e836d/3e851448078f5b01f6264915df3cfef75e323a12/c1dc0524ab2cc3982d4e0d2bfac71a0cd4d65c39/c9c2a51f91aea70e89b496cac360cd795a2b3c26/910d7749346c4b0acdc6e4adfdc4a9984281a206/21ee79ce938127f88fe07e409c1817f477dbe7ea/7b7387650dcf2881fd8bb55bcf3c8bd6c9542dd7
Timeline
04/16/2025 CVE reserved10/20/2025 Advisory disclosed
10/20/2025 VulDB entry created
02/12/2026 VulDB entry last update
Sources
Vendor: kernel.orgAdvisory: git.kernel.org
Status: Confirmed
CVE: CVE-2025-40006 (🔒)
GCVE (CVE): GCVE-0-2025-40006
GCVE (VulDB): GCVE-100-329059
CERT Bund: WID-SEC-2025-2350 - Linux Kernel: Mehrere Schwachstellen
Entry
Created: 10/20/2025 22:19Updated: 02/12/2026 16:56
Changes: 10/20/2025 22:19 (59), 10/27/2025 20:59 (2), 02/12/2026 16:56 (7)
Complete: 🔍
Cache ID: 216::103
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
No comments yet. Languages: en.
Please log in to comment.