drm/imagination: Count paired job fence as dependency in prepare_job()
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/imagination: Count paired job fence as dependency in prepare_job()
The DRM scheduler's prepare_job() callback counts the remaining non-signaled native dependencies for a job, preventing job submission until those (plus job data and fence update) can fit in the job queue's CCCB.
This means checking which dependencies can be waited upon in the firmware, i.e. whether they are backed by a UFO object, i.e. whether their drm_sched_fence::parent has been assigned to a pvr_queue_fence::base fence. That happens when the job owning the fence is submitted to the firmware.
Paired geometry and fragment jobs are submitted at the same time, which means the dependency between them can't be checked this way before submission.
Update job_count_remaining_native_deps() to take into account the dependency between paired jobs.
This fixes cases where prepare_job() underestimated the space left in an almost full fragment CCCB, wrongly unblocking run_job(), which then returned early without writing the full sequence of commands to the CCCB.
The above lead to kernel warnings such as the following and potentially job timeouts (depending on waiters on the missing commands):
From the CVE record · Linux
The Linux kernel's Imagination DRM scheduler can underestimate queue space when preparing paired geometry and fragment jobs. If the fragment command queue is almost full, it may submit a job without writing all its commands, causing kernel warnings and potentially job timeouts. The input does not specify an attacker route, authentication requirement, or user interaction.
Engineers running Linux kernels with the Imagination DRM driver should check their builds; affected versions are not specified.