accel/amdxdna: put the chained BO when its mapping fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
7.2.77.3In the Linux kernel, the following vulnerability has been resolved:
accel/amdxdna: put the chained BO when its mapping fails
amdxdna_cmd_set_error() looks up the first BO of a command chain, which takes a reference, and drops it at the end of the function. The mapping of that BO is established in between, and the failure path returns without the put, so the reference is leaked.
Ordinary use does not reach it. The chain has been submitted before any of this runs, so aie2_cmdlist_fill_slot() has already called amdxdna_cmd_get_op() on that BO and amdxdna_gem_vmap() has cached its address. What makes it reachable is that the BO is resolved again by handle here, and the handle is userspace's to recycle: closing it after submission and importing a dma-buf whose exporter implements no vmap onto the same id leaves amdxdna_gem_get_obj() returning an object this cannot map, since prime_import() types every import AMDXDNA_BO_SHARE.
From the CVE record · Linux
The Linux kernel's accel/amdxdna driver leaks a buffer-object reference when mapping fails in amdxdna_cmd_set_error(). A local userspace process can reach this failure path by closing a submitted command chain's buffer-object handle and reusing that handle for an imported dma-buf whose exporter does not support vmap; ordinary use does not reach it.
Engineers running Linux kernels with the accel/amdxdna driver should check whether their kernel is affected; affected versions were not provided.