CVE-2026-31703: writeback: Fix use after free in inode_switch_wbs_work_fn()
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.
Security readout for executives and security teams
Plain-English summary
A Linux kernel writeback worker can access memory after its backing object has been freed. A local user with limited privileges may potentially compromise confidentiality, integrity, or availability. The source bundle does not establish that exploitation is practical in every affected configuration.
Executive priority
Treat as a high-priority kernel update for affected multi-user systems and systems running untrusted local workloads. It is not described as remotely exploitable, but successful local exploitation could have severe system-wide consequences. Confirm distribution-specific status promptly.
Technical view
A race in inode_switch_wbs_work_fn() can leave switch_work pending while switch_wbs_ctxs is empty. Without a queued item holding a reference, the writeback object may be freed before pending work executes, causing a use-after-free. The kernel fix removes the processing loop to preserve the required object lifetime.
Likely exposure
The bundle lists Linux versions 6.18, 6.18.25, 7.0.2, and 7.1 as affected, plus an ambiguous entry labeled "0." Exposure requires local, low-privileged access. Distribution backports may alter exposure, so package-level vendor confirmation is necessary.
Exploitation context
The CVSS 3.1 score is 7.8 with local access, low complexity, low privileges, and no user interaction. The bundle marks the CVE as absent from KEV and provides no cited evidence of active exploitation or a public exploit.
Researcher notes
The issue is classified as CWE-825 and concerns writeback-object lifetime management around queued work. The source explains the race and corrective design, but does not demonstrate exploitability, identify triggering configurations, or provide reliable version-range semantics for the anomalous "0" entry.
Mitigation direction
Upgrade to a vendor-supported kernel release containing the applicable stable fix.
Use the referenced stable commits to verify backport status for each deployed kernel.
Where immediate patching is impossible, reduce untrusted local access and monitor vendor guidance.
Reboot into the corrected kernel after installation and confirm it is running.
Validation and detection
Inventory running kernel versions across Linux hosts, appliances, and virtual-machine guests.
Compare each distribution package against vendor advisories and the referenced stable commits.
Confirm the installed fix survives reboot by checking the active kernel version.
Review kernel logs for unexplained writeback-related crashes; absence does not prove safety.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-825: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
1ADP providers
10Source links
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-825 · source CWE mapping
Expired Pointer Dereference
Expired Pointer Dereference represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.