Cloudanix VulnDB

CVE-2025-39885

None

CVSS

—

EPSS

0.1%

Published

Sep 23, 2025

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in the Linux kernel's OCFS2 file system can freeze the entire system when certain file-mapping operations are performed on specially prepared files.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
Moderate
Impact
Denial Of Service
Component
OS kernel
Class
Race Condition
Remediation
Patch
Effort
Medium
Patch risk
Low

What it actually does

Recursive read-to-write semaphore deadlock in OCFS2 ip_alloc_sem during fiemap on a specially crafted mmap file, where page fault handling in fiemap_fill_next_extent triggers ocfs2_page_mkwrite while the semaphore is already held, causing filesystem hang.

Why it matters to the business

Filesystem-level hangs on OCFS2 volumes can interrupt workloads, cause service outages, and require manual intervention or reboot; widespread Linux kernel exposure increases operational risk for storage-dependent environments even with low exploit probability.

How an attack unfolds

An attacker on a local system creates a specially crafted mmap file backed by OCFS2, maps it executable, and issues FS_IOC_FIEMAP ioctl; the resulting page fault during extent list copy triggers recursive semaphore acquisition leading to deadlock and hang. Related kernel privilege escalation activity by groups such as VMSCAPE underscores ongoing kernel surface risks.

How to fix it

Upgrade to fixed kernel versions: Debian 11/12/13/14 packages 3.2.20-1 or mainline commit 16e518ca84dfe860c20a62f3615e14e8af0ace57. Rebuild and reboot systems using OCFS2; apply vendor kernel updates promptly given the 399-day publication window.

How to confirm the fix worked

Verify running kernel version against fixed packages or commit hash; reproduce fiemap operations on test OCFS2 volumes with mmap files to confirm absence of deadlock; review changelog entries referencing ocfs2_fiemap and ip_alloc_sem changes.

Typical attack path

  1. Create or obtain a specially crafted file on OCFS2
  2. Memory-map the file with executable permissions
  3. Invoke FS_IOC_FIEMAP ioctl on the file descriptor
  4. Trigger page fault during fiemap_fill_next_extent copy_to_user
  5. Induce recursive semaphore deadlock and filesystem hang

How to detect it

Search kernel logs and dmesg for OCFS2 hang traces involving rwsem_down_write_slowpath, ocfs2_page_mkwrite, and fiemap_fill_next_extent; correlate with processes issuing FS_IOC_FIEMAP on OCFS2 mounts; review audit logs for unusual mmap+ioctl sequences on cluster filesystems.

What your security team should do

  • Prioritize kernel upgrades on all OCFS2 hosts within standard change windows
  • Disable or restrict untrusted local ioctl access where feasible
  • Monitor kernel logs and process hangs for OCFS2 semaphore-related stalls
  • Track EPSS trend and related kernel CVEs for cumulative risk assessment

The record

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 packages

Ecosystem Package Introduced Fixed
Debian:11 linux 0 No fix
Debian:12 linux 0 6.1.153-1
Debian:13 linux 0 6.12.48-1
Debian:14 linux 0 No fix
Linux Kernel 2.6.28 5.4.300
Mageia:9 kernel 0 6.6.116-1.mga9
Mageia:9 kernel-linus 0 6.6.116-1.mga9
Mageia:9 kmod-virtualbox 0 7.1.14-13.mga9
Mageia:9 kmod-xtables-addons 0 3.24-87.mga9
SUSE:Linux Enterprise High Availability Extension 15 SP6 kernel-default 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Live Patching 12 SP5 kernel-default 0 4.12.14-122.275.1
SUSE:Linux Enterprise Live Patching 12 SP5 kgraft-patch-SLE12-SP5_Update_73 0 1-8.3.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-default 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6-RT_Update_16 0 1-150600.1.3.1
SUSE:Linux Enterprise Live Patching 15 SP6 kernel-livepatch-SLE15-SP6_Update_16 0 1-150600.13.3.1
SUSE:Linux Enterprise Live Patching 15 SP7 kernel-livepatch-SLE15-SP7-RT_Update_5 0 1-150700.1.3.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-64kb 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-default-base 0 6.4.0-150600.23.73.1.150600.12.32.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-source 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 kernel-zfcpdump 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-docs 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-obs-build 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-source 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Development Tools 15 SP6 kernel-syms 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 kernel-default 0 6.4.0-150600.23.73.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-azure 0 6.4.0-150600.8.52.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-source-azure 0 6.4.0-150600.8.52.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP6 kernel-syms-azure 0 6.4.0-150600.8.52.1
SUSE:Linux Enterprise Server 12 SP5-LTSS kernel-default 0 4.12.14-122.275.1
SUSE:Linux Enterprise Server 12 SP5-LTSS kernel-source 0 4.12.14-122.275.1
SUSE:Linux Enterprise Server 12 SP5-LTSS kernel-syms 0 4.12.14-122.275.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 kernel-default 0 4.12.14-122.275.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 kernel-source 0 4.12.14-122.275.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 kernel-syms 0 4.12.14-122.275.1
SUSE:Linux Enterprise Workstation Extension 15 SP6 kernel-default 0 6.4.0-150600.23.73.1
SUSE:Real Time Module 15 SP6 kernel-rt 0 6.4.0-150600.10.55.1
SUSE:Real Time Module 15 SP6 kernel-rt_debug 0 6.4.0-150600.10.55.1
SUSE:Real Time Module 15 SP6 kernel-source-rt 0 6.4.0-150600.10.55.1
SUSE:Real Time Module 15 SP6 kernel-syms-rt 0 6.4.0-150600.10.55.1
SUSE:Real Time Module 15 SP7 kernel-rt 0 6.4.0-150700.7.19.1
SUSE:Real Time Module 15 SP7 kernel-source-rt 0 6.4.0-150700.7.19.1
SUSE:Real Time Module 15 SP7 kernel-syms-rt 0 6.4.0-150700.7.19.1
openSUSE:Leap 15.6 dtb-aarch64 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-64kb 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-azure 0 6.4.0-150600.8.52.1
openSUSE:Leap 15.6 kernel-debug 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-default 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-default-base 0 6.4.0-150600.23.73.1.150600.12.32.1
openSUSE:Leap 15.6 kernel-docs 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-kvmsmall 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-obs-build 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-obs-qa 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-rt 0 6.4.0-150600.10.55.1
openSUSE:Leap 15.6 kernel-rt_debug 0 6.4.0-150600.10.55.1
openSUSE:Leap 15.6 kernel-source 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-source-azure 0 6.4.0-150600.8.52.1
openSUSE:Leap 15.6 kernel-source-rt 0 6.4.0-150600.10.55.1
openSUSE:Leap 15.6 kernel-syms 0 6.4.0-150600.23.73.1
openSUSE:Leap 15.6 kernel-syms-azure 0 6.4.0-150600.8.52.1
openSUSE:Leap 15.6 kernel-syms-rt 0 6.4.0-150600.10.55.1
openSUSE:Leap 15.6 kernel-zfcpdump 0 6.4.0-150600.23.73.1
openSUSE:Leap 16.0 dtb-aarch64 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-64kb 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-default 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-default-base 0 6.12.0-160000.6.1.160000.2.4
openSUSE:Leap 16.0 kernel-docs 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-kvmsmall 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-obs-build 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-obs-qa 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-rt 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-source 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-syms 0 6.12.0-160000.6.1
openSUSE:Leap 16.0 kernel-zfcpdump 0 6.12.0-160000.6.1

Related vulnerabilities