# CVE-2026-31598: ocfs2: fix possible deadlock between unlink and dio\_end\_io\_write

- Priority: **Prioritise**
- Reason: Severe, CVSS 7.5 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 0% (FIRST, 05-12-2026)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2026-04-24 · Modified: 2026-10-19
- Aliases: UBUNTU-CVE-2026-31598, DEBIAN-CVE-2026-31598, CGA-4f2h-qh73-r9f8, CGA-85rq-95wv-gw7w, CGA-c44g-hvx2-m665, CGA-gm84-4hhf-x2qv, CGA-h2pv-5pvj-7fhp, CGA-jqp5-3vqg-6gh6, CGA-m8fh-389j-624c, CGA-p84j-qchg-3qmx, CGA-pr22-vrwm-385p
- Record: https://cvemate.com/vulnerability/CVE-2026-31598 · JSON: https://cvemate.com/vulnerability/CVE-2026-31598/json

## Description

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

ocfs2: fix possible deadlock between unlink and dio_end_io_write

ocfs2_unlink takes orphan dir inode_lock first and then ip_alloc_sem,
while in ocfs2_dio_end_io_write, it acquires these locks in reverse order.
This creates an ABBA lock ordering violation on lock classes
ocfs2_sysfile_lock_key[ORPHAN_DIR_SYSTEM_INODE] and
ocfs2_file_ip_alloc_sem_key.

Lock Chain #0 (orphan dir inode_lock -> ip_alloc_sem):
ocfs2_unlink
  ocfs2_prepare_orphan_dir
    ocfs2_lookup_lock_orphan_dir
      inode_lock(orphan_dir_inode) <- lock A
    __ocfs2_prepare_orphan_dir
      ocfs2_prepare_dir_for_insert
        ocfs2_extend_dir
	  ocfs2_expand_inline_dir
	    down_write(&oi->ip_alloc_sem) <- Lock B

Lock Chain #1 (ip_alloc_sem -> orphan dir inode_lock):
ocfs2_dio_end_io_write
  down_write(&oi->ip_alloc_sem) <- Lock B
  ocfs2_del_inode_from_orphan()
    inode_lock(orphan_dir_inode) <- Lock A

Deadlock Scenario:
  CPU0 (unlink)                     CPU1 (dio_end_io_write)
  ------                            ------
  inode_lock(orphan_dir_inode)
                                    down_write(ip_alloc_sem)
  down_write(ip_alloc_sem)
                                    inode_lock(orphan_dir_inode)

Since ip_alloc_sem is to protect allocation changes, which is unrelated
with operations in ocfs2_del_inode_from_orphan.  So move
ocfs2_del_inode_from_orphan out of ip_alloc_sem to fix the deadlock.
```

## Signals

- CVSS: 7.5 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.452%, percentile 41.005%, as of 2026-12-05
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 170)

- chainguard linux-aws-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-aws-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-azure-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-gcp-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-qemu-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-qemu-6.18 (Chainguard): \< 6.18.31-r0
- chainguard linux-qemu-6.18-bootc-boot-installed (Chainguard): \< 6.18.31-r0
- chainguard linux-vmware-6.12 (Chainguard): \< 6.12.85-r0
- chainguard linux-vmware-6.18 (Chainguard): \< 6.18.31-r0
- debian linux (Debian): \< 6.1.176-1 \| \< 6.12.85-1 \| \< 6.19.14-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-186.196 \| \< 6.8.0-136.136 \| \< 7.0.0-27.27
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 5.15.0-1112.119 \| \< 6.8.0-1061.64 \| \< 7.0.0-1008.8
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1112.119~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 48)

- <https://git.kernel.org/stable/c/297d8d7bb6a2bf133d3a3636edbdf94101cbd719>
- <https://git.kernel.org/stable/c/32630dee18c6bb2175c8a865a474749492eaf19c>
- <https://git.kernel.org/stable/c/93f35419eb84d58820040642cb6e7528fe4aba7a>
- <https://git.kernel.org/stable/c/4b80b5a838a32437f2cae0662578bac216a2c51a>
- <https://git.kernel.org/stable/c/2b884d52273c60c298bd570163e8053657bbaff6>
- <https://git.kernel.org/stable/c/bc0fb5c7d54c78be43a536df0e20dee32adb27d3>
- <https://git.kernel.org/stable/c/f9fb1a7b635849322e1d7b7b6b26389778ec8e82>
- <https://git.kernel.org/stable/c/e049f7a9bd80b7319590789ea5e1c523d6339d91>
- <https://git.kernel.org/stable/c/b02da26a992db0c0e2559acbda0fc48d4a2fd337>
- <https://ubuntu.com/security/CVE-2026-31598>
- <https://www.cve.org/CVERecord?id=CVE-2026-31598>
- <https://git.kernel.org/linus/b02da26a992db0c0e2559acbda0fc48d4a2fd337>
- <https://ubuntu.com/security/notices/USN-8488-1>
- <https://ubuntu.com/security/notices/USN-8488-2>
- <https://ubuntu.com/security/notices/USN-8507-1>
- <https://ubuntu.com/security/notices/USN-8569-1>
- <https://ubuntu.com/security/notices/USN-8567-1>
- <https://ubuntu.com/security/notices/USN-8574-1>
- <https://ubuntu.com/security/notices/USN-8575-1>
- <https://ubuntu.com/security/notices/USN-8576-1>

---

Data as of 2026-12-06T04:08:41.985Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
