CVE-2026-31703: writeback: Fix use after free in inode_switch_wbs_work_fn()

Published May 1, 2026
·
Updated

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

writeback: Fix use after free in inodeswitchwbsworkfn()

inodeswitchwbsworkfn() has a loop like:

wbget(newwb); while (1) { list = llistdelall(&newwb->switchwbsctxs); / Nothing to do? / if (!list) break; ... process the items ... }

Now adding of items to the list looks like:

wbqueueisw() if (llistadd(&isw->list, &wb->switchwbsctxs)) queuework(iswwq, &wb->switchwork);

Because inodeswitchwbsworkfn() loops when processing isw items, it can happen that wb->switchwork is pending while wb->switchwbsctxs 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 wbget() in inodeswitchwbsworkfn(). 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 inodeswitchwbsworkfn() instead. That way when wbqueueisw() queues work, we are guaranteed we have added the first item to wb->switchwbsctxs and nobody is going to remove it (and drop the wb reference it holds) until the queued work runs.

Affected Software

5 affected components
Linux Linux kernel
Linux Linux kernel>=6.18<6.18.25
Linux Linux kernel>=6.19<7.0.2
Linux Linux kernel=7.1-rc1
Linux Linux kernel=7.1-rc2

Event History

May 1, 2026
CVE Published
via MITRE·01:56 PM
Data Sourced
via MITRE·01:56 PM
DescriptionSeverity
Data Sourced
via NVD·02:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·03:03 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-31703?

The severity of CVE-2026-31703 is classified as high due to its impact on memory safety in the Linux kernel.

2

How do I fix CVE-2026-31703?

To fix CVE-2026-31703, update your Linux kernel to the latest version that includes the patch for this vulnerability.

3

What systems are affected by CVE-2026-31703?

CVE-2026-31703 affects specific versions of the Linux kernel, particularly those with the writeback subsystem.

4

What type of vulnerability is CVE-2026-31703?

CVE-2026-31703 is a use-after-free vulnerability, which can lead to memory corruption and potential system compromise.

5

Is CVE-2026-31703 actively exploited?

As of now, there are no public reports indicating that CVE-2026-31703 is actively being exploited in the wild.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203