# CVE-2025-40247: drm/msm: Fix pgtable prealloc error path

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.26% (percentile 11, 2026-11-26)
- **Published:** 2025-12-04T16:08:10.696Z
- **Modified:** 2026-10-19T19:10:00.130Z

## Who should check

- Anyone running Linux \>= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, \< b865da18b6cb878f33b5920693d03f23b9c4d1a3; \>= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, \< 830d68f2cb8ab6fb798bb9555016709a9e012af0
- Anyone running Linux 3.12

## Description

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

drm/msm: Fix pgtable prealloc error path

The following splat was reported:

    Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
    Mem abort info:
      ESR = 0x0000000096000004
      EC = 0x25: DABT (current EL), IL = 32 bits
      SET = 0, FnV = 0
      EA = 0, S1PTW = 0
      FSC = 0x04: level 0 translation fault
    Data abort info:
      ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
      CM = 0, WnR = 0, TnD = 0, TagAccess = 0
      GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
    user pgtable: 4k pages, 48-bit VAs, pgdp=00000008d0fd8000
    \[0000000000000010\] pgd=0000000000000000, p4d=0000000000000000
    Internal error: Oops: 0000000096000004 \[\#1\]  SMP
    CPU: 5 UID: 1000 PID: 149076 Comm: Xwayland Tainted: G S                  6.16.0-rc2-00809-g0b6974bb4134-dirty \#367 PREEMPT
    Tainted: \[S\]=CPU\_OUT\_OF\_SPEC
    Hardware name: Qualcomm Technologies, Inc. SM8650 HDK (DT)
    pstate: 83400005 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
    pc : build\_detached\_freelist+0x28/0x224
    lr : kmem\_cache\_free\_bulk.part.0+0x38/0x244
    sp : ffff000a508c7a20
    x29: ffff000a508c7a20 x28: ffff000a508c7d50 x27: ffffc4e49d16f350
    x26: 0000000000000058 x25: 00000000fffffffc x24: 0000000000000000
    x23: ffff00098c4e1450 x22: 00000000fffffffc x21: 0000000000000000
    x20: ffff000a508c7af8 x19: 0000000000000002 x18: 00000000000003e8
    x17: ffff000809523850 x16: ffff000809523820 x15: 0000000000401640
    x14: ffff000809371140 x13: 0000000000000130 x12: ffff0008b5711e30
    x11: 00000000001058fa x10: 0000000000000a80 x9 : ffff000a508c7940
    x8 : ffff000809371ba0 x7 : 781fffe033087fff x6 : 0000000000000000
    x5 : ffff0008003cd000 x4 : 781fffe033083fff x3 : ffff000a508c7af8
    x2 : fffffdffc0000000 x1 : 0001000000000000 x0 : ffff0008001a6a00
    Call trace:
     build\_detached\_freelist+0x28/0x224 (P)
     kmem\_cache\_free\_bulk.part.0+0x38/0x244
     kmem\_cache\_free\_bulk+0x10/0x1c
     msm\_iommu\_pagetable\_prealloc\_cleanup+0x3c/0xd0
     msm\_vma\_job\_free+0x30/0x240
     msm\_ioctl\_vm\_bind+0x1d0/0x9a0
     drm\_ioctl\_kernel+0x84/0x104
     drm\_ioctl+0x358/0x4d4
     \_\_arm64\_sys\_ioctl+0x8c/0xe0
     invoke\_syscall+0x44/0x100
     el0\_svc\_common.constprop.0+0x3c/0xe0
     do\_el0\_svc+0x18/0x20
     el0\_svc+0x30/0x100
     el0t\_64\_sync\_handler+0x104/0x130
     el0t\_64\_sync+0x170/0x174
    Code: aa0203f5 b26287e2 f2dfbfe2 aa0303f4 (f8737ab6)
    ---\[ end trace 0000000000000000 \]---

Since msm\_vma\_job\_free() is called directly from the ioctl, this looks
like an error path cleanup issue.  Which I think results from
prealloc\_cleanup() called without a preceding successful
prealloc\_allocate() call.  So handle that case better.

Patchwork: https://patchwork.freedesktop.org/patch/678677/

## Affected and fixed versions

- Linux: \>= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, \< b865da18b6cb878f33b5920693d03f23b9c4d1a3; \>= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, \< 830d68f2cb8ab6fb798bb9555016709a9e012af0 (cvelist)
- Linux: 3.12 (cvelist)

## Mitigation

- Upgrade Linux to 830d68f2cb8ab6fb798bb9555016709a9e012af0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-40247. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-40247.md
Affected: Linux >= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, < b865da18b6cb878f33b5920693d03f23b9c4d1a3; >= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, < 830d68f2cb8ab6fb798bb9555016709a9e012af0; Linux 3.12
Fixed in: Linux 830d68f2cb8ab6fb798bb9555016709a9e012af0

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-40247 being exploited?

There is no confirmed exploitation: CVE-2025-40247 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.26% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-40247?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2025-40247?

Linux \>= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, \< b865da18b6cb878f33b5920693d03f23b9c4d1a3; \>= 0cf6c71d70d8aa39b8fd0e39c9009602a0e0d300, \< 830d68f2cb8ab6fb798bb9555016709a9e012af0; Linux 3.12.

### Is there a fix for CVE-2025-40247?

Yes. Fixed in Linux 830d68f2cb8ab6fb798bb9555016709a9e012af0. Upgrade Linux to 830d68f2cb8ab6fb798bb9555016709a9e012af0 or later.

### How do I check if I'm affected by CVE-2025-40247?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/b865da18b6cb878f33b5920693d03f23b9c4d1a3>
- other: <https://git.kernel.org/stable/c/830d68f2cb8ab6fb798bb9555016709a9e012af0>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-40247>

HTML: <https://flawdb.com/CVE-2025-40247> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-40247>
