drm/amdkfd: Let driver decide buffer size at AMDKFD_IOC_GET_DMABUF_INFO ioctl
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/amdkfd: Let driver decide buffer size at AMDKFD_IOC_GET_DMABUF_INFO ioctl
amdkfd driver needs allocate buffer to return bo metadata to user space. The buffer size is controlled by user currently. It is a potential security issue that hostile value (e.g. 2 GiB) lets any render-group user trigger order-MAX allocation/OOM in kernel context.
This patch first finds bo metadata size. If the size is smaller than user provided value drive can safely allocate buffer in kernel space and copy to user space buffer. If not, driver will let user know, not allocate and copy. User will redo with new buffer in user space.
This patch lets driver decide buffer allocation size to avoid potential hostile size from user space.
(cherry picked from commit f54ce9e8cbd3abe0eda3a285f54dc4f572fe589a)
From the CVE record · Linux
The amdkfd driver lets users control the size of a kernel buffer allocated by the AMDKFD_IOC_GET_DMABUF_INFO ioctl. A local render-group user can provide a hostile size that may trigger an out-of-memory condition in the kernel; no further user interaction is described.
Teams running Linux kernels with the affected amdkfd driver should check their kernel versions; affected versions are not specified.