CVE-2026-64416

Source
https://cve.org/CVERecord?id=CVE-2026-64416
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64416.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-64416
Downstream
Published
2026-07-25T08:50:55.997Z
Modified
2026-07-27T04:03:19.376682673Z
Summary
mm: swap_cgroup: fix NULL deref in lookup_swap_cgroup_id on swapless host
Details

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

mm: swapcgroup: fix NULL deref in lookupswapcgroupid on swapless host

lookupswapcgroupid() passes swapcgroup_ctrl[type].map to __swapcgroupidlookup() without checking that the type was ever registered via swapcgroup_swapon(). On a swapless host every ctrl->map is NULL, so __swapcgroupidlookup() dereferences NULL + a scaled swpoffset().

Since commit bea67dcc5eea ("mm: attempt to batch free swap entries for zappterange()"), zappterange() -> swapptebatch() calls lookupswapcgroupid() on any non-present, non-none PTE that decodes as a real swap entry, without first validating it against swapinfo[]. A single PTE corrupted into a type-0 swap entry takes the host down at process exit.

We hit this in production on a swapless 6.12.58 host: ~1s of "getswapdevice: Bad swap file entry 3f800204222bb" (doswappage() being correctly defensive about the same entry) followed by

BUG: unable to handle page fault for address: 000003f800204220 RIP: 0010:lookupswapcgroupid+0x2b/0x60 Call Trace: swapptebatch+0xbf/0x230 zappterange+0x4c8/0x780 unmappagerange+0x190/0x3e0 exitmmap+0xd9/0x3c0 do_exit+0x20c/0x4b0

syzbot has reported the identical stack.

The source of the PTE corruption is a separate bug; this change makes the teardown path as robust as the fault path already is. Every other caller of lookupswapcgroupid() is downstream of a getswap_device() that has already validated the entry, so the new branch is cold.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64416.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
bea67dcc5eea0f6a213897a59b9e644977cd07e6
Fixed
818416fef38759f23210de449663cd9d7e293d39
Fixed
b415c00bf23df577a4a95673d00ae76687bcc1d4
Fixed
6a4196d19f477524d2f92adca90fc1fbe9a0420a
Fixed
63b02a9409cb5180398491b093e48bcb5315f5fb

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64416.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.12.0
Fixed
6.12.97
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.39
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.1.4

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64416.json"