drm/amdgpu: fix bo->pin leaking in amdgpu_bo_create_reserved
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in Kernel e06e0885725a16304b7723aeb478a78cca9dc96a, Kernel 2f390b4c83011452753fd84972f657d2b00a952b, Kernel 51eeef1949c11d3dcb5f422a5d9b3f09ebe8a1bc and 12 more.
In the Linux kernel, the following vulnerability has been resolved: drm/amdgpu: fix bo->pin leaking in amdgpu_bo_create_reserved amdgpu_bo_create_reserved() only allocates a new BO when *bo_ptr (struct amdgpu_bo **bo_ptr as input parameter) is NULL, it simply skips creation when *bo_ptr is non-NULL. But it unconditionally reserves, pins, gart allocates and maps the BO afterwards. When the same non-NULL BO pointer is passed in again, for example firmware buffers that live in adev and are re-loaded on every resume / cp_resume / start under AMDGPU_FW_LOAD_DIRECT, amdgpu_bo_pin() just increases pin_count unconditionally, however the matching teardown only unpins once, so pin_count never drops to zero, so TTM is not able to move, swap or evict a BO, causing BO leaks. This commit fixes this issue by only pinning the bo once at creation, and repeated calls no longer take additional pin references. (cherry picked from commit 3ddc0ae76202c447b6aec61e907b852bc94671cf)
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| Linux | Kernel | >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <e06e0885725a16304b7723aeb478a78cca9dc96a, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <2f390b4c83011452753fd84972f657d2b00a952b, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <51eeef1949c11d3dcb5f422a5d9b3f09ebe8a1bc, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <7aea619d9f186dcf0f1289879e9edb69d2b56639, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <9743f60013273987abf415dc47474683d22aaee9, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <a2f895f3c852063258d62e9f74b081de07ca95df, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <b572d0814c1366701ca704286589fab025802566, >=53766e5adac75872e9d413cdbfd0e47ae40701f9 <ba7b6444097a73ccd3d3ac9e2be4ebb73d226460, =4.14 | e06e0885725a16304b7723aeb478a78cca9dc96a, 2f390b4c83011452753fd84972f657d2b00a952b, 51eeef1949c11d3dcb5f422a5d9b3f09ebe8a1bc, 7aea619d9f186dcf0f1289879e9edb69d2b56639, 9743f60013273987abf415dc47474683d22aaee9, a2f895f3c852063258d62e9f74b081de07ca95df, b572d0814c1366701ca704286589fab025802566, ba7b6444097a73ccd3d3ac9e2be4ebb73d226460 |
| linux-kernel: Kernel | >=5.11.0 <5.15.216, >=5.16.0 <6.1.183, >=6.13.0 <6.18.42, >=6.19.0 <7.1.6, >=6.2.0 <6.6.148, >=6.7.0 <6.12.101, >=4.14.0 <5.10.265 | 5.15.216, 6.1.183, 6.18.42, 7.1.6, 6.6.148, 6.12.101, 5.10.265 |
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in Kernel, strongest first
Embed
A live severity badge for an advisory, README or ticket