# CVE-2025-39731: f2fs: vm\_unmap\_ram() may be called from an invalid context

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **Published:** 2025-09-07T15:16:20.023Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< eb69e69a5ae6c8350957893b5f68bd55b1565fb2; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 1023836d1b9465593c8746f97d608da32958785f; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 0fe7976b62546f1e95eebfe9879925e9aa22b7a8; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 411e00f44e2e1a7fdb526013b25a7f0ed22a0947; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 18eea36f4f460ead3750ed4afe5496f7ce55f99e; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 08a7efc5b02a0620ae16aa9584060e980a69cb55
- Anyone running Linux 6.0

## Description

In the Linux kernel, the following vulnerability has been resolved:

f2fs: vm\_unmap\_ram() may be called from an invalid context

When testing F2FS with xfstests using UFS backed virtual disks the
kernel complains sometimes that f2fs\_release\_decomp\_mem() calls
vm\_unmap\_ram() from an invalid context. Example trace from
f2fs/007 test:

f2fs/007 5s ...  \[12:59:38\]\[    8.902525\] run fstests f2fs/007
\[   11.468026\] BUG: sleeping function called from invalid context at mm/vmalloc.c:2978
\[   11.471849\] in\_atomic(): 1, irqs\_disabled(): 1, non\_block: 0, pid: 68, name: irq/22-ufshcd
\[   11.475357\] preempt\_count: 1, expected: 0
\[   11.476970\] RCU nest depth: 0, expected: 0
\[   11.478531\] CPU: 0 UID: 0 PID: 68 Comm: irq/22-ufshcd Tainted: G        W           6.16.0-rc5-xfstests-ufs-g40f92e79b0aa \#9 PREEMPT(none)
\[   11.478535\] Tainted: \[W\]=WARN
\[   11.478536\] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
\[   11.478537\] Call Trace:
\[   11.478543\]  \<TASK\>
\[   11.478545\]  dump\_stack\_lvl+0x4e/0x70
\[   11.478554\]  \_\_might\_resched.cold+0xaf/0xbe
\[   11.478557\]  vm\_unmap\_ram+0x21/0xb0
\[   11.478560\]  f2fs\_release\_decomp\_mem+0x59/0x80
\[   11.478563\]  f2fs\_free\_dic+0x18/0x1a0
\[   11.478565\]  f2fs\_finish\_read\_bio+0xd7/0x290
\[   11.478570\]  blk\_update\_request+0xec/0x3b0
\[   11.478574\]  ? sbitmap\_queue\_clear+0x3b/0x60
\[   11.478576\]  scsi\_end\_request+0x27/0x1a0
\[   11.478582\]  scsi\_io\_completion+0x40/0x300
\[   11.478583\]  ufshcd\_mcq\_poll\_cqe\_lock+0xa3/0xe0
\[   11.478588\]  ufshcd\_sl\_intr+0x194/0x1f0
\[   11.478592\]  ufshcd\_threaded\_intr+0x68/0xb0
\[   11.478594\]  ? \_\_pfx\_irq\_thread\_fn+0x10/0x10
\[   11.478599\]  irq\_thread\_fn+0x20/0x60
\[   11.478602\]  ? \_\_pfx\_irq\_thread\_fn+0x10/0x10
\[   11.478603\]  irq\_thread+0xb9/0x180
\[   11.478605\]  ? \_\_pfx\_irq\_thread\_dtor+0x10/0x10
\[   11.478607\]  ? \_\_pfx\_irq\_thread+0x10/0x10
\[   11.478609\]  kthread+0x10a/0x230
\[   11.478614\]  ? \_\_pfx\_kthread+0x10/0x10
\[   11.478615\]  ret\_from\_fork+0x7e/0xd0
\[   11.478619\]  ? \_\_pfx\_kthread+0x10/0x10
\[   11.478621\]  ret\_from\_fork\_asm+0x1a/0x30
\[   11.478623\]  \</TASK\>

This patch modifies in\_task() check inside f2fs\_read\_end\_io() to also
check if interrupts are disabled. This ensures that pages are unmapped
asynchronously in an interrupt handler.

## Affected and fixed versions

- Linux: \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< eb69e69a5ae6c8350957893b5f68bd55b1565fb2; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 1023836d1b9465593c8746f97d608da32958785f; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 0fe7976b62546f1e95eebfe9879925e9aa22b7a8; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 411e00f44e2e1a7fdb526013b25a7f0ed22a0947; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 18eea36f4f460ead3750ed4afe5496f7ce55f99e; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 08a7efc5b02a0620ae16aa9584060e980a69cb55 (cvelist)
- Linux: 6.0 (cvelist)

## Mitigation

- Upgrade Linux to 08a7efc5b02a0620ae16aa9584060e980a69cb55 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-39731. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-39731.md
Affected: Linux >= bff139b49d9f70c1ac5384aac94554846aa834de, < eb69e69a5ae6c8350957893b5f68bd55b1565fb2; >= bff139b49d9f70c1ac5384aac94554846aa834de, < 1023836d1b9465593c8746f97d608da32958785f; >= bff139b49d9f70c1ac5384aac94554846aa834de, < 0fe7976b62546f1e95eebfe9879925e9aa22b7a8; >= bff139b49d9f70c1ac5384a…
Fixed in: Linux 1023836d1b9465593c8746f97d608da32958785f, Linux 0fe7976b62546f1e95eebfe9879925e9aa22b7a8, Linux 411e00f44e2e1a7fdb526013b25a7f0ed22a0947, Linux 18eea36f4f460ead3750ed4afe5496f7ce55f99e, Linux 08a7efc5b02a0620ae16aa9584060e980a69cb55

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-39731 being exploited?

There is no confirmed exploitation: CVE-2025-39731 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-39731?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-39731?

Linux \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< eb69e69a5ae6c8350957893b5f68bd55b1565fb2; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 1023836d1b9465593c8746f97d608da32958785f; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 0fe7976b62546f1e95eebfe9879925e9aa22b7a8; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 411e00f44e2e1a7fdb526013b25a7f0ed22a0947; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 18eea36f4f460ead3750ed4afe5496f7ce55f99e; \>= bff139b49d9f70c1ac5384aac94554846aa834de, \< 08a7efc5b02a0620ae16aa9584060e980a69cb55; Linux 6.0.

### Is there a fix for CVE-2025-39731?

Yes. Fixed in Linux 1023836d1b9465593c8746f97d608da32958785f, Linux 0fe7976b62546f1e95eebfe9879925e9aa22b7a8, Linux 411e00f44e2e1a7fdb526013b25a7f0ed22a0947, Linux 18eea36f4f460ead3750ed4afe5496f7ce55f99e, Linux 08a7efc5b02a0620ae16aa9584060e980a69cb55. Upgrade Linux to 08a7efc5b02a0620ae16aa9584060e980a69cb55 or later.

### How do I check if I'm affected by CVE-2025-39731?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/eb69e69a5ae6c8350957893b5f68bd55b1565fb2>
- patch: <https://git.kernel.org/stable/c/1023836d1b9465593c8746f97d608da32958785f>
- patch: <https://git.kernel.org/stable/c/0fe7976b62546f1e95eebfe9879925e9aa22b7a8>
- patch: <https://git.kernel.org/stable/c/411e00f44e2e1a7fdb526013b25a7f0ed22a0947>
- patch: <https://git.kernel.org/stable/c/18eea36f4f460ead3750ed4afe5496f7ce55f99e>
- patch: <https://git.kernel.org/stable/c/08a7efc5b02a0620ae16aa9584060e980a69cb55>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-39731>

HTML: <https://flawdb.com/CVE-2025-39731> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-39731>
