CVE-2025-38389

Source
https://cve.org/CVERecord?id=CVE-2025-38389
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38389.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-38389
Downstream
Related
Published
2025-07-25T12:53:29.394Z
Modified
2026-03-12T02:18:50.959607Z
Summary
drm/i915/gt: Fix timeline left held on VMA alloc error
Details

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

drm/i915/gt: Fix timeline left held on VMA alloc error

The following error has been reported sporadically by CI when a test unbinds the i915 driver on a ring submission platform:

<4> [239.330153] ------------[ cut here ]------------ <4> [239.330166] i915 0000:00:02.0: [drm] drmWARNON(devpriv->mm.shrinkcount) <4> [239.330196] WARNING: CPU: 1 PID: 18570 at drivers/gpu/drm/i915/i915gem.c:1309 i915gemcleanupearly+0x13e/0x150 [i915] ... <4> [239.330640] RIP: 0010:i915gemcleanupearly+0x13e/0x150 [i915] ... <4> [239.330942] Call Trace: <4> [239.330944] <TASK> <4> [239.330949] i915driverlaterelease+0x2b/0xa0 [i915] <4> [239.331202] i915driverrelease+0x86/0xa0 [i915] <4> [239.331482] devmdrmdevinitrelease+0x61/0x90 <4> [239.331494] devmactionrelease+0x15/0x30 <4> [239.331504] releasenodes+0x3d/0x120 <4> [239.331517] devresreleaseall+0x96/0xd0 <4> [239.331533] deviceunbindcleanup+0x12/0x80 <4> [239.331543] devicereleasedriverinternal+0x23a/0x280 <4> [239.331550] ? busfinddevice+0xa5/0xe0 <4> [239.331563] devicedriverdetach+0x14/0x20 ... <4> [357.719679] ---[ end trace 0000000000000000 ]---

If the test also unloads the i915 module then that's followed with:

<3> [357.787478] ============================================================================= <3> [357.788006] BUG i915_vma (Tainted: G U W N ): Objects remaining on __kmemcacheshutdown() <3> [357.788031] ----------------------------------------------------------------------------- <3> [357.788204] Object 0xffff888109e7f480 @offset=29824 <3> [357.788670] Allocated in i915vmainstance+0xee/0xc10 [i915] age=292729 cpu=4 pid=2244 <4> [357.788994] i915vmainstance+0xee/0xc10 [i915] <4> [357.789290] initstatuspage+0x7b/0x420 [i915] <4> [357.789532] intelenginesinit+0x1d8/0x980 [i915] <4> [357.789772] intelgtinit+0x175/0x450 [i915] <4> [357.790014] i915geminit+0x113/0x340 [i915] <4> [357.790281] i915driverprobe+0x847/0xed0 [i915] <4> [357.790504] i915pciprobe+0xe6/0x220 [i915] ...

Closer analysis of CI results history has revealed a dependency of the error on a few IGT tests, namely: - igt@apiintelallocator@fork-simple-stress-signal, - igt@apiintelallocator@two-level-inception-interruptible, - igt@gemlinearblits@interruptible, - igt@primemmapcoherency@ioctl-errors, which invisibly trigger the issue, then exhibited with first driver unbind attempt.

All of the above tests perform actions which are actively interrupted with signals. Further debugging has allowed to narrow that scope down to DRMIOCTLI915GEMEXECBUFFER2, and ringcontextalloc(), specific to ring submission, in particular.

If successful then that function, or its execlists or GuC submission equivalent, is supposed to be called only once per GEM context engine, followed by raise of a flag that prevents the function from being called again. The function is expected to unwind its internal errors itself, so it may be safely called once more after it returns an error.

In case of ring submission, the function first gets a reference to the engine's legacy timeline and then allocates a VMA. If the VMA allocation fails, e.g. when i915vmainstance() called from inside is interrupted with a signal, then ringcontextalloc() fails, leaving the timeline held referenced. On next I915GEMEXECBUFFER2 IOCTL, another reference to the timeline is got, and only that last one is put on successful completion. As a consequence, the legacy timeline, with its underlying engine status page's VMA object, is still held and not released on driver unbind.

Get the legacy timeline only after successful allocation of the context engine's VMA.

v2: Add a note on other submission methods (Krzysztof Karas): Both execlists and GuC submission use lrc_alloc() which seems free from a similar issue.

(cherry picked from commit cc43422b3cc79eacff4c5a8ba0d224688ca9dd4f)

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38389.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
75d0a7f31eec8ec4a53b4485905800e09dc5091f
Fixed
60b757730884e4a223152a68d9b5f625dac94119
Fixed
e47d7d6edc40a6ace7cc04e5893759fee68569f5
Fixed
f10af34261448610d4048ac6e6af87f80e3881a4
Fixed
4c778c96e469fb719b11683e0a3be8ea68052fa2
Fixed
40e09506aea1fde1f3e0e04eca531bbb23404baf
Fixed
5a7ae7bebdc4c2ecd48a2c061319956f65c09473
Fixed
c542d62883f62ececafcb630a1c5010133826bea
Fixed
a5aa7bc1fca78c7fa127d9e33aa94a0c9066c1d6

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38389.json"