CVE-2026-31703
writeback: Fix use after free in inode_switch_wbs_work_fn()
Check your servers for CVE-2026-31703
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-31703 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
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.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.12%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 2.10% of all scored CVEs. Scores of 1 Dec 2026.
Weakness
- CWE-825 Expired Pointer Dereference
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from d072b38a64ddbc2d58c2e525a24af24ecbfebcb7, before 382cf81cae89e58d22b4bdc38891cd4d0b9ba921 affected from ac7b2c21f2269d815ad0cdf0f8258d55185b805c, before 19ec404b079be057b387643ba0c69bbcc5867c35 affected from fabfc1fcddc5d8185722d4fde5f0968c4760b71e, before 156cc63691c1f20905510b1007896e090355e6c2 affected from e1b849cfa6b61f1c866a908c9e8dd9b5aaab820b, before 028103656b84273c73e9e271cf95c9f3421f4b8a affected from e1b849cfa6b61f1c866a908c9e8dd9b5aaab820b, before 9223e5f30403a9b506d6d0bff4f2e29a2d7d46af affected from e1b849cfa6b61f1c866a908c9e8dd9b5aaab820b, before 6689f01d6740cf358932b3e97ee968c6099800d9
Other versions: unaffected
|
| Linux |
affected 6.18 unaffected before 6.18 unaffected from 6.18.25 up to and including 6.18.* unaffected from 7.0.2 up to and including 7.0.* unaffected 7.1 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2026-31703 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2026-31703
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2026-31703
trivy image --scanners vuln IMAGE | grep CVE-2026-31703
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- https://access.redhat.com/security/cve/CVE-2026-31703 access.redhat.com · vdb entry
- RHBZ#2464385 bugzilla.redhat.com · issue tracking
Other references
- https://git.kernel.org/stable/c/382cf81cae89e58d22b4bdc38891cd4d0b9ba921 git.kernel.org
- https://git.kernel.org/stable/c/19ec404b079be057b387643ba0c69bbcc5867c35 git.kernel.org
- https://git.kernel.org/stable/c/156cc63691c1f20905510b1007896e090355e6c2 git.kernel.org
- https://git.kernel.org/stable/c/028103656b84273c73e9e271cf95c9f3421f4b8a git.kernel.org
- https://git.kernel.org/stable/c/9223e5f30403a9b506d6d0bff4f2e29a2d7d46af git.kernel.org
- https://git.kernel.org/stable/c/6689f01d6740cf358932b3e97ee968c6099800d9 git.kernel.org
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31703.json security.access.redhat.com
Source: the record CVE-2026-31703 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse