# CVE-2025-39885: ocfs2: fix recursive semaphore deadlock in fiemap call

> 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.18% (percentile 4, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2025-09-23T06:00:52.584Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 16e518ca84dfe860c20a62f3615e14e8af0ace57; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 7e1514bd44ef68007703c752c99ff7319f35bce6; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< ef30404980e4c832ef9bba1b10c08f67fa77a9ec; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 36054554772f95d090eb45793faf6aa3c0254b02; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 0709bc11b942870fc0a7be150e42aea42321093a; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 1d3c96547ee2ddeaddf8f19a3ef99ea06cc8115e; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 9efcb7a8b97310efed995397941a292cf89fa94f; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 04100f775c2ea501927f508f17ad824ad1f23c8d
- Anyone running Linux 2.6.28

## Description

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

ocfs2: fix recursive semaphore deadlock in fiemap call

syzbot detected a OCFS2 hang due to a recursive semaphore on a
FS\_IOC\_FIEMAP of the extent list on a specially crafted mmap file.

context\_switch kernel/sched/core.c:5357 \[inline\]
   \_\_schedule+0x1798/0x4cc0 kernel/sched/core.c:6961
   \_\_schedule\_loop kernel/sched/core.c:7043 \[inline\]
   schedule+0x165/0x360 kernel/sched/core.c:7058
   schedule\_preempt\_disabled+0x13/0x30 kernel/sched/core.c:7115
   rwsem\_down\_write\_slowpath+0x872/0xfe0 kernel/locking/rwsem.c:1185
   \_\_down\_write\_common kernel/locking/rwsem.c:1317 \[inline\]
   \_\_down\_write kernel/locking/rwsem.c:1326 \[inline\]
   down\_write+0x1ab/0x1f0 kernel/locking/rwsem.c:1591
   ocfs2\_page\_mkwrite+0x2ff/0xc40 fs/ocfs2/mmap.c:142
   do\_page\_mkwrite+0x14d/0x310 mm/memory.c:3361
   wp\_page\_shared mm/memory.c:3762 \[inline\]
   do\_wp\_page+0x268d/0x5800 mm/memory.c:3981
   handle\_pte\_fault mm/memory.c:6068 \[inline\]
   \_\_handle\_mm\_fault+0x1033/0x5440 mm/memory.c:6195
   handle\_mm\_fault+0x40a/0x8e0 mm/memory.c:6364
   do\_user\_addr\_fault+0x764/0x1390 arch/x86/mm/fault.c:1387
   handle\_page\_fault arch/x86/mm/fault.c:1476 \[inline\]
   exc\_page\_fault+0x76/0xf0 arch/x86/mm/fault.c:1532
   asm\_exc\_page\_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0010:copy\_user\_generic arch/x86/include/asm/uaccess\_64.h:126 \[inline\]
RIP: 0010:raw\_copy\_to\_user arch/x86/include/asm/uaccess\_64.h:147 \[inline\]
RIP: 0010:\_inline\_copy\_to\_user include/linux/uaccess.h:197 \[inline\]
RIP: 0010:\_copy\_to\_user+0x85/0xb0 lib/usercopy.c:26
Code: e8 00 bc f7 fc 4d 39 fc 72 3d 4d 39 ec 77 38 e8 91 b9 f7 fc 4c 89
f7 89 de e8 47 25 5b fd 0f 01 cb 4c 89 ff 48 89 d9 4c 89 f6 \<f3\> a4 0f
1f 00 48 89 cb 0f 01 ca 48 89 d8 5b 41 5c 41 5d 41 5e 41
RSP: 0018:ffffc9000403f950 EFLAGS: 00050256
RAX: ffffffff84c7f101 RBX: 0000000000000038 RCX: 0000000000000038
RDX: 0000000000000000 RSI: ffffc9000403f9e0 RDI: 0000200000000060
RBP: ffffc9000403fa90 R08: ffffc9000403fa17 R09: 1ffff92000807f42
R10: dffffc0000000000 R11: fffff52000807f43 R12: 0000200000000098
R13: 00007ffffffff000 R14: ffffc9000403f9e0 R15: 0000200000000060
   copy\_to\_user include/linux/uaccess.h:225 \[inline\]
   fiemap\_fill\_next\_extent+0x1c0/0x390 fs/ioctl.c:145
   ocfs2\_fiemap+0x888/0xc90 fs/ocfs2/extent\_map.c:806
   ioctl\_fiemap fs/ioctl.c:220 \[inline\]
   do\_vfs\_ioctl+0x1173/0x1430 fs/ioctl.c:532
   \_\_do\_sys\_ioctl fs/ioctl.c:596 \[inline\]
   \_\_se\_sys\_ioctl+0x82/0x170 fs/ioctl.c:584
   do\_syscall\_x64 arch/x86/entry/syscall\_64.c:63 \[inline\]
   do\_syscall\_64+0xfa/0x3b0 arch/x86/entry/syscall\_64.c:94
   entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
RIP: 0033:0x7f5f13850fd9
RSP: 002b:00007ffe3b3518b8 EFLAGS: 00000246 ORIG\_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000200000000000 RCX: 00007f5f13850fd9
RDX: 0000200000000040 RSI: 00000000c020660b RDI: 0000000000000004
RBP: 6165627472616568 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe3b3518f0
R13: 00007ffe3b351b18 R14: 431bde82d7b634db R15: 00007f5f1389a03b

ocfs2\_fiemap() takes a read lock of the ip\_alloc\_sem semaphore (since
v2.6.22-527-g7307de80510a) and calls fiemap\_fill\_next\_extent() to read the
extent list of this running mmap executable.  The user supplied buffer to
hold the fiemap information page faults calling ocfs2\_page\_mkwrite() which
will take a write lock (since v2.6.27-38-g00dc417fa3e7) of the same
semaphore.  This recursive semaphore will hold filesystem locks and causes
a hang of the fileystem.

The ip\_alloc\_sem protects the inode extent list and size.  Release the
read semphore before calling fiemap\_fill\_next\_extent() in ocfs2\_fiemap()
and ocfs2\_fiemap\_inline().  This does an unnecessary semaphore lock/unlock
on the last extent but simplifies the error path.

## Affected and fixed versions

- Linux: \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 16e518ca84dfe860c20a62f3615e14e8af0ace57; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 7e1514bd44ef68007703c752c99ff7319f35bce6; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< ef30404980e4c832ef9bba1b10c08f67fa77a9ec; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 36054554772f95d090eb45793faf6aa3c0254b02; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 0709bc11b942870fc0a7be150e42aea42321093a; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 1d3c96547ee2ddeaddf8f19a3ef99ea06cc8115e; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 9efcb7a8b97310efed995397941a292cf89fa94f; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 04100f775c2ea501927f508f17ad824ad1f23c8d (cvelist)
- Linux: 2.6.28 (cvelist)

## Mitigation

- Upgrade Linux to 04100f775c2ea501927f508f17ad824ad1f23c8d 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-39885. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-39885.md
Affected: Linux >= 00dc417fa3e763345b34ccb6034d72de76eea0a1, < 16e518ca84dfe860c20a62f3615e14e8af0ace57; >= 00dc417fa3e763345b34ccb6034d72de76eea0a1, < 7e1514bd44ef68007703c752c99ff7319f35bce6; >= 00dc417fa3e763345b34ccb6034d72de76eea0a1, < ef30404980e4c832ef9bba1b10c08f67fa77a9ec; >= 00dc417fa3e763345b34ccb…
Fixed in: Linux 16e518ca84dfe860c20a62f3615e14e8af0ace57, Linux 7e1514bd44ef68007703c752c99ff7319f35bce6, Linux 36054554772f95d090eb45793faf6aa3c0254b02, Linux 0709bc11b942870fc0a7be150e42aea42321093a, Linux 1d3c96547ee2ddeaddf8f19a3ef99ea06cc8115e, Linux 9efcb7a8b97310efed995397941a292cf89fa94f, Linux 04100…

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-39885 being exploited?

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

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

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

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

Linux \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 16e518ca84dfe860c20a62f3615e14e8af0ace57; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 7e1514bd44ef68007703c752c99ff7319f35bce6; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< ef30404980e4c832ef9bba1b10c08f67fa77a9ec; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 36054554772f95d090eb45793faf6aa3c0254b02; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 0709bc11b942870fc0a7be150e42aea42321093a; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 1d3c96547ee2ddeaddf8f19a3ef99ea06cc8115e; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 9efcb7a8b97310efed995397941a292cf89fa94f; \>= 00dc417fa3e763345b34ccb6034d72de76eea0a1, \< 04100f775c2ea501927f508f17ad824ad1f23c8d; Linux 2.6.28.

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

Yes. Fixed in Linux 16e518ca84dfe860c20a62f3615e14e8af0ace57, Linux 7e1514bd44ef68007703c752c99ff7319f35bce6, Linux 36054554772f95d090eb45793faf6aa3c0254b02, Linux 0709bc11b942870fc0a7be150e42aea42321093a, Linux 1d3c96547ee2ddeaddf8f19a3ef99ea06cc8115e, Linux 9efcb7a8b97310efed995397941a292cf89fa94f, Linux 04100f775c2ea501927f508f17ad824ad1f23c8d. Upgrade Linux to 04100f775c2ea501927f508f17ad824ad1f23c8d or later.

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

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/16e518ca84dfe860c20a62f3615e14e8af0ace57>
- patch: <https://git.kernel.org/stable/c/7e1514bd44ef68007703c752c99ff7319f35bce6>
- patch: <https://git.kernel.org/stable/c/ef30404980e4c832ef9bba1b10c08f67fa77a9ec>
- patch: <https://git.kernel.org/stable/c/36054554772f95d090eb45793faf6aa3c0254b02>
- patch: <https://git.kernel.org/stable/c/0709bc11b942870fc0a7be150e42aea42321093a>
- patch: <https://git.kernel.org/stable/c/1d3c96547ee2ddeaddf8f19a3ef99ea06cc8115e>
- patch: <https://git.kernel.org/stable/c/9efcb7a8b97310efed995397941a292cf89fa94f>
- patch: <https://git.kernel.org/stable/c/04100f775c2ea501927f508f17ad824ad1f23c8d>
- 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-39885>

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