CVE-2025-38338
BaseFortify
Publication date: 2025-07-10
Last updated on: 2025-11-18
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
| linux | linux_kernel | From 5.15.160 (inc) to 5.16 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-415 | The product calls free() twice on the same memory address. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is a double-unlock bug in the Linux kernel's NFS file reading code. When a file is read while being truncated by another NFS client, the kernel may deadlock because a function called folio_unlock() is called twice on the same memory folio. This causes the kernel to wait indefinitely for a lock that is never properly held, leading to processes getting stuck or warnings being triggered.
How can this vulnerability impact me? :
The vulnerability can cause processes that read files over NFS to deadlock or hang indefinitely, potentially leading to system instability or degraded performance. In some cases, kernel warnings may be logged. This can disrupt normal file operations and affect system reliability when using NFS with concurrent file truncation.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability may be detected by observing kernel warnings related to folio locking issues, specifically warnings from netfs_read_collection such as: "WARNING: CPU: ... folio ... is not locked". Additionally, processes stuck indefinitely in folio_wait_bit_common() waiting for PG_locked to clear may indicate the issue. Monitoring kernel logs (e.g., using 'dmesg' or 'journalctl -k') for such warnings can help detect the problem. Specific commands include: 'dmesg | grep netfs_read_collection' or 'journalctl -k | grep folio'.
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation involves updating the Linux kernel to a version where the double-unlock bug in nfs_return_empty_folio() has been fixed. Since the issue arises from improper folio unlocking during NFS reads with fscache enabled, applying the patch that adds the missing nfs_netfs_folio_unlock() check in nfs_return_empty_folio() will resolve the deadlock and warning issues.