{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-31703","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-03-09T15:48:24.132Z","datePublished":"2026-05-01T13:56:02.415Z","dateUpdated":"2026-08-20T12:32:00.881Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:24:38.863Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nwriteback: Fix use after free in inode_switch_wbs_work_fn()\n\ninode_switch_wbs_work_fn() has a loop like:\n\n  wb_get(new_wb);\n  while (1) {\n    list = llist_del_all(&new_wb->switch_wbs_ctxs);\n    /* Nothing to do? */\n    if (!list)\n      break;\n    ... process the items ...\n  }\n\nNow adding of items to the list looks like:\n\nwb_queue_isw()\n  if (llist_add(&isw->list, &wb->switch_wbs_ctxs))\n    queue_work(isw_wq, &wb->switch_work);\n\nBecause inode_switch_wbs_work_fn() loops when processing isw items, it\ncan happen that wb->switch_work is pending while wb->switch_wbs_ctxs is\nempty. This is a problem because in that case wb can get freed (no isw\nitems -> no wb reference) while the work is still pending causing\nuse-after-free issues.\n\nWe cannot just fix this by cancelling work when freeing wb because that\ncould still trigger problematic 0 -> 1 transitions on wb refcount due to\nwb_get() in inode_switch_wbs_work_fn(). It could be all handled with\nmore careful code but that seems unnecessarily complex so let's avoid\nthat until it is proven that the looping actually brings practical\nbenefit. Just remove the loop from inode_switch_wbs_work_fn() instead.\nThat way when wb_queue_isw() queues work, we are guaranteed we have\nadded the first item to wb->switch_wbs_ctxs and nobody is going to\nremove it (and drop the wb reference it holds) until the queued work\nruns."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable writeback path is reached through local filesystem dirtying/writeback and cgroup writeback switching, not by direct network packet handling.\nAC:L - The bug is a race, but an attacker with local execution in writable/delegated cgroups can create concurrent inode switch requests and cgroup writeback object teardown repeatedly.\nPR:L - Triggering requires a local unprivileged user context able to dirty files and use writable/delegated cgroups; it does not require real root-only kernel capabilities.\nUI:N - No separate victim action is required once the attacker can run local code and drive writes, fsync/sync, and cgroup activity.\nS:U - The impact remains within the kernel security authority; this is not a guest-to-host, IOMMU, or other cross-scope boundary issue.\nC:H - This is a kernel use-after-free of a bdi_writeback object containing workqueue state, and such memory corruption can be leveraged for kernel memory disclosure.\nI:H - The freed object includes asynchronously executed work state, making control-flow or heap manipulation primitives defensible for integrity impact.\nA:H - At minimum, the stale pending work can dereference freed kernel memory and cause a kernel oops or panic."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/fs-writeback.c"],"versions":[{"version":"d072b38a64ddbc2d58c2e525a24af24ecbfebcb7","lessThan":"382cf81cae89e58d22b4bdc38891cd4d0b9ba921","status":"affected","versionType":"git"},{"version":"ac7b2c21f2269d815ad0cdf0f8258d55185b805c","lessThan":"19ec404b079be057b387643ba0c69bbcc5867c35","status":"affected","versionType":"git"},{"version":"fabfc1fcddc5d8185722d4fde5f0968c4760b71e","lessThan":"156cc63691c1f20905510b1007896e090355e6c2","status":"affected","versionType":"git"},{"version":"e1b849cfa6b61f1c866a908c9e8dd9b5aaab820b","lessThan":"028103656b84273c73e9e271cf95c9f3421f4b8a","status":"affected","versionType":"git"},{"version":"e1b849cfa6b61f1c866a908c9e8dd9b5aaab820b","lessThan":"9223e5f30403a9b506d6d0bff4f2e29a2d7d46af","status":"affected","versionType":"git"},{"version":"e1b849cfa6b61f1c866a908c9e8dd9b5aaab820b","lessThan":"6689f01d6740cf358932b3e97ee968c6099800d9","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/fs-writeback.c"],"versions":[{"version":"6.18","status":"affected"},{"version":"0","lessThan":"6.18","status":"unaffected","versionType":"semver"},{"version":"6.18.25","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.0.2","lessThanOrEqual":"7.0.*","status":"unaffected","versionType":"semver"},{"version":"7.1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.18.25"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.0.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"7.1"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/382cf81cae89e58d22b4bdc38891cd4d0b9ba921"},{"url":"https://git.kernel.org/stable/c/19ec404b079be057b387643ba0c69bbcc5867c35"},{"url":"https://git.kernel.org/stable/c/156cc63691c1f20905510b1007896e090355e6c2"},{"url":"https://git.kernel.org/stable/c/028103656b84273c73e9e271cf95c9f3421f4b8a"},{"url":"https://git.kernel.org/stable/c/9223e5f30403a9b506d6d0bff4f2e29a2d7d46af"},{"url":"https://git.kernel.org/stable/c/6689f01d6740cf358932b3e97ee968c6099800d9"}],"title":"writeback: Fix use after free in inode_switch_wbs_work_fn()","x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"affected":[{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:10"],"defaultStatus":"unaffected","packageName":"kernel","product":"Red Hat Enterprise Linux 10","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:6"],"defaultStatus":"unaffected","packageName":"kernel","product":"Red Hat Enterprise Linux 6","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:7"],"defaultStatus":"unaffected","packageName":"kernel","product":"Red Hat Enterprise Linux 7","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:7"],"defaultStatus":"unaffected","packageName":"kernel-rt","product":"Red Hat Enterprise Linux 7","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:8"],"defaultStatus":"unaffected","packageName":"kernel","product":"Red Hat Enterprise Linux 8","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:8"],"defaultStatus":"unaffected","packageName":"kernel-rt","product":"Red Hat Enterprise Linux 8","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:9"],"defaultStatus":"unaffected","packageName":"kernel","product":"Red Hat Enterprise Linux 9","vendor":"Red Hat"},{"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:9"],"defaultStatus":"unaffected","packageName":"kernel-rt","product":"Red Hat Enterprise Linux 9","vendor":"Red Hat"}],"datePublic":"2026-05-01T00:00:00.000Z","descriptions":[{"lang":"en","value":"A flaw was found in the Linux kernel. A use-after-free vulnerability exists in the `inode_switch_wbs_work_fn()` function, part of the kernel's writeback subsystem. This issue arises when a work item remains active after its associated memory object (`wb`) has been released, leading to system instability. An attacker could potentially exploit this vulnerability to cause a denial of service."}],"metrics":[{"other":{"content":{"namespace":"https://access.redhat.com/security/updates/classification/","value":"Moderate"},"type":"Red Hat severity rating"}},{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"LOCAL","availabilityImpact":"HIGH","baseScore":7,"baseSeverity":"HIGH","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"LOW","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"format":"CVSS"}],"problemTypes":[{"descriptions":[{"cweId":"CWE-825","description":"Expired Pointer Dereference","lang":"en","type":"CWE"}]}],"references":[{"tags":["vdb-entry","x_refsource_REDHAT"],"url":"https://access.redhat.com/security/cve/CVE-2026-31703"},{"name":"RHBZ#2464385","tags":["issue-tracking","x_refsource_REDHAT"],"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2464385"},{"tags":["x_sadp-csaf-vex"],"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-31703.json"}],"timeline":[{"lang":"en","time":"2026-05-01T00:00:00.000Z","value":"Reported to Red Hat."},{"lang":"en","time":"2026-05-01T00:00:00.000Z","value":"Made public."}],"title":"kernel: writeback: Fix use after free in inode_switch_wbs_work_fn()","x_adpType":"supplier","x_generator":{"engine":"sadp-cli 1.0.0"},"providerMetadata":{"orgId":"0b0ca135-0b70-47e7-9f44-1890c2a1c46c","shortName":"redhat-SADP","dateUpdated":"2026-08-20T12:32:00.881Z"}}]}}