accel/amdxdna: Use caller client for debug BO sync
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 |
|
|
In the Linux kernel, the following vulnerability has been resolved:
accel/amdxdna: Use caller client for debug BO sync
amdxdna_drm_sync_bo_ioctl() looks up args->handle in the ioctl caller's drm_file. For SYNC_DIRECT_FROM_DEVICE, it then calls amdxdna_hwctx_sync_debug_bo(), but passes abo->client.
amdxdna_hwctx_sync_debug_bo() uses the passed client both as the handle namespace for debug_bo_hdl and as the owner of the hardware context xarray. Those must match the file that supplied args->handle. The BO's stored client pointer is object state, not the ioctl context.
Pass filp->driver_priv instead, matching the original handle lookup.
From the CVE record · Linux
The Linux kernel’s amdxdna driver passes a buffer object’s stored client to debug BO sync instead of the client associated with the ioctl caller. This can cause debug buffer handles and hardware contexts to be looked up under the wrong client when a caller invokes sync with SYNC_DIRECT_FROM_DEVICE; the input does not specify a further attacker impact or authentication requirements.
Engineers running Linux kernels with the amdxdna driver should check whether their kernel includes the fix; affected versions are not specified.