drm/lima: call drm_mm_init() with a valid allocation range
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ a1d2a6339961efc078208dc3b2f006e9e9a8e119 · < e2a7cee341986cb5b544a8286edc7fb0494c592e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/lima: call drm_mm_init() with a valid allocation range
lima_vm_create() is currently run before va_start and va_end are set up, meaning they are both 0. lima_vm_create() runs drm_mm_init() with them as arguments for the allocator, and if DRM_DEBUG_MM is enabled the DRM_MM_BUG_ON check in drm_mm_init then fires, as seen here on exynos4412-odroid-u2:
[ 1.736297] ------------[ cut here ]------------ [ 1.740370] kernel BUG at drivers/gpu/drm/drm_mm.c:931! [ 1.745574] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 1.750697] Modules linked in: [ 1.753734] CPU: 0 UID: 0 PID: 41 Comm: kworker/u16:1 Not tainted 7.0.10-postmarketos-exynos4 #11 PREEMPT [ 1.763372] Hardware name: Samsung Exynos (Flattened Device Tree) [ 1.769446] Workqueue: events_unbound deferred_probe_work_func [ 1.775261] PC is at drm_mm_init+0x9c/0xa4 [ 1.779339] LR is at lima_vm_create+0x144/0x17c [ ... ]
Fix the issue by moving the lima_vm_create() call after va_start and va_end are set up.
From the CVE record · Linux
The Lima DRM driver initializes a memory allocator before setting its allocation range. When DRM_DEBUG_MM is enabled, this can trigger a kernel BUG during driver initialization and crash the kernel. The input does not describe an attacker, authentication requirement, or user interaction.
Engineers running Linux kernels with the Lima DRM driver should check whether their kernel includes this fix; affected versions are not specified.