CVE-2025-40336 drm/gpusvm: fix hmm_pfn_to_map_order() usage

High 8.8 Published Updated

A flaw in the Linux kernel GPU SVM driver allows mapping memory outside intended ranges, potentially leading to memory corruption and privilege escalation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-40336?

CVE-2025-40336 is a high-severity memory corruption vulnerability in Linux, published on 9 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

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

drm/gpusvm: fix hmm_pfn_to_map_order() usage

Handle the case where the hmm range partially covers a huge page (like 2M), otherwise we can potentially end up doing something nasty like mapping memory which is outside the range, and maybe not even mapped by the mm. Fix is based on the xe userptr code, which in a future patch will directly use gpusvm, so needs alignment here.

v2: - Add kernel-doc (Matt B) - s/fls/ilog2/ (Thomas)

Which versions are affected by CVE-2025-40336?

How do I fix CVE-2025-40336?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2025-40336 being exploited?

There is no known exploitation of CVE-2025-40336 in the wild and no public exploit code.

Sources

Also known as BELL-CVE-2025-40336, DEBIAN-CVE-2025-40336, GHSA-5gqx-mjr7-rp8x, ROOT-OS-DEBIAN-12-CVE-2025-40336, ROOT-OS-DEBIAN-13-CVE-2025-40336, ROOT-OS-UBUNTU-2204-CVE-2025-40336 and 2 more.

Is CVE-2025-40336 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free