drm: Do not allow userspace to trigger kernel warnings in drm_gem_change_handle_ioctl()
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:
drm: Do not allow userspace to trigger kernel warnings in drm_gem_change_handle_ioctl()
Since GEM bo handles are u32 in the uapi and the internal implementation uses idr_alloc() which uses int ranges, passing a new handle larger than INT_MAX trivially triggers a kernel warning:
idr_alloc(): ... if (WARN_ON_ONCE(start < 0)) return -EINVAL; ...
Fix it by rejecting new handles above INT_MAX and at the same time make the end limit calculation more obvious by moving into int domain.
From the CVE record · Linux
The Linux kernel's DRM GEM handle-change ioctl can trigger a kernel warning when userspace supplies a new handle larger than INT_MAX. A local userspace caller can trigger the warning by passing such a handle; the input does not specify whether authentication is required.
Engineers running Linux kernels with the affected DRM GEM handle-change ioctl should check their systems; affected versions are not specified.