CVE-2026-31703 json
writeback: Fix use after free in inode_switch_wbs_work_fn()
published 2026-05-01 6 mo ago modified 2026-08-20 2 mo ago also EUVD-2026-26512
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.1%
- EPSS 0.1% chance of exploitation in 30 days, percentile 1%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
writeback: Fix use after free in inode_switch_wbs_work_fn()
inode_switch_wbs_work_fn() has a loop like:
wb_get(new_wb); while (1) { list = llist_del_all(&new_wb->switch_wbs_ctxs); /* Nothing to do? */ if (!list) break; ... process the items ... }
Now adding of items to the list looks like:
wb_queue_isw() if (llist_add(&isw->list, &wb->switch_wbs_ctxs)) queue_work(isw_wq, &wb->switch_work);
Because inode_switch_wbs_work_fn() loops when processing isw items, it can happen that wb->switch_work is pending while wb->switch_wbs_ctxs is empty. This is a problem because in that case wb can get freed (no isw items -> no wb reference) while the work is still pending causing use-after-free issues.
We cannot just fix this by cancelling work when freeing wb because that could still trigger problematic 0 -> 1 transitions on wb refcount due to wb_get() in inode_switch_wbs_work_fn(). It could be all handled with more careful code but that seems unnecessarily complex so let's avoid that until it is proven that the looping actually brings practical benefit. Just remove the loop from inode_switch_wbs_work_fn() instead. That way when wb_queue_isw() queues work, we are guaranteed we have added the first item to wb->switch_wbs_ctxs and nobody is going to remove it (and drop the wb reference it holds) until the queued work runs.
Patch / fix
- Linux Linux 6.18.25, 7.0.2, 7.1
- linux Debian 14 7.0.3-1
debian advisories DEBIAN-CVE-2026-31703
- linux Ubuntu 26.04 LTS 7.0.0-27.27
- linux-aws Ubuntu 26.04 LTS 7.0.0-1008.8
- linux-gcp Ubuntu 26.04 LTS 7.0.0-1007.7
- linux-ibm Ubuntu 26.04 LTS 7.0.0-1009.9
- linux-azure Ubuntu 26.04 LTS 7.0.0-1010.10
- linux-raspi Ubuntu 26.04 LTS 7.0.0-1014.14
- linux-riscv Ubuntu 26.04 LTS 7.0.0-27.27.1
- linux-nvidia Ubuntu 26.04 LTS 7.0.0-1013.13
ubuntu advisories UBUNTU-CVE-2026-31703
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-48.1
- kernel-source-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-48.1
- kernel-rt Real Time Module 15 SP7 6.4.0-150700.7.59.2
- kernel-syms-rt Real Time Module 15 SP7 6.4.0-150700.7.59.1
- kernel-source-rt Real Time Module 15 SP7 6.4.0-150700.7.59.2
- kernel-64kb SLE Module for Basesystem 15 SP7 6.4.0-150700.53.60.1
- kernel-syms SLE Module for Development Tools 15 SP7 6.4.0-150700.53.60.1
- kernel-azure SLE Module for Public Cloud 15 SP7 6.4.0-150700.53.60.1
suse advisories SUSE-SU-2026:22433-1SUSE-SU-2026:22458-1SUSE-SU-2026:2591-1SUSE-SU-2026:2482-1SUSE-SU-2026:22108-1SUSE-SU-2026:22137-1
- kernel-rt openSUSE Leap 16.0 6.12.0-160000.35.1
- dtb-aarch64 openSUSE Leap 16.0 6.12.0-160000.35.1
- kernel-64kb openSUSE Leap 16.0 6.12.0-160000.35.1
- kernel-syms openSUSE Leap 16.0 6.12.0-160000.35.1
- kernel-azure openSUSE Leap 16.0 6.12.0-160000.35.1
- kernel-obs-qa openSUSE Leap 16.0 6.12.0-160000.35.1
- kernel-source openSUSE Leap 16.0 6.12.0-160000.35.1
- kernel-default openSUSE Leap 16.0 6.12.0-160000.35.1
opensuse advisories openSUSE-SU-2026:20965-1openSUSE-SU-2026:10793-1
- git.kernel.org/stable/c/382cf81cae89e58d22b4bdc38891cd4d0b9ba921 commit
- git.kernel.org/stable/c/19ec404b079be057b387643ba0c69bbcc5867c35 commit
- git.kernel.org/stable/c/156cc63691c1f20905510b1007896e090355e6c2 commit
- git.kernel.org/stable/c/028103656b84273c73e9e271cf95c9f3421f4b8a commit
- git.kernel.org/stable/c/9223e5f30403a9b506d6d0bff4f2e29a2d7d46af commit
- git.kernel.org/stable/c/6689f01d6740cf358932b3e97ee968c6099800d9 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-31703 updated cvss 7.0
kernel: writeback: Fix use after free in inode_switch_wbs_work_fn()
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
0.12% chance of exploitation in the next 30 days, higher than 1% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CISA ADP | 3.1 | 7.0 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
| CNA | 3.1 | 7.0 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
- Red Hat Red Hat Enterprise Linux 10
- Red Hat Red Hat Enterprise Linux 6
- Red Hat Red Hat Enterprise Linux 7
- Red Hat Red Hat Enterprise Linux 8
- Red Hat Red Hat Enterprise Linux 9
Classification
- Weakness
- Technology feeds
References
- git.kernel.org /stable/c/382cf81cae89e58d22b4bdc38891cd4d0b9ba921
- git.kernel.org /stable/c/19ec404b079be057b387643ba0c69bbcc5867c35
- git.kernel.org /stable/c/156cc63691c1f20905510b1007896e090355e6c2
-
git.kernel.org
/stable/c/028103656b84273c73e9e271cf95c9f3421f4b8a
patch
-
git.kernel.org
/stable/c/9223e5f30403a9b506d6d0bff4f2e29a2d7d46af
patch
-
git.kernel.org
/stable/c/6689f01d6740cf358932b3e97ee968c6099800d9
patch
-
access.redhat.com
/security/cve/CVE-2026-31703
vdb-entry
-
bugzilla.redhat.com
/show_bug.cgi?id=2464385
issue-tracking
- security.access.redhat.com /data/csaf/v2/vex/2026/cve-2026-31703.json
Sources
- CVE List CVE-2026-31703
- NVD CVE-2026-31703
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.