accel/amdxdna: Fix use-after-free of mm_struct in job scheduler
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 |
|
|
6.18.427.1.67.2In the Linux kernel, the following vulnerability has been resolved:
accel/amdxdna: Fix use-after-free of mm_struct in job scheduler
amdxdna_cmd_submit() stores current->mm in job->mm without holding any reference. aie2_sched_job_run() later access job->mm from the DRM scheduler worker thread. With only a raw pointer and no structural reference, the mm_struct can be freed before the scheduler runs the job.
Fix this by calling mmgrab() to hold a structural mm_count reference for the lifetime of the job, paired with mmdrop() in every cleanup path.
From the CVE record · Linux
The Linux kernel's amdxdna job scheduler can access a freed mm_struct because command submission stores a pointer without holding a reference. This can occur when a locally submitted job runs after the mm_struct is freed; the input does not specify authentication requirements or further impact.
Engineers running Linux kernels with the amdxdna driver should check whether their kernel includes the fix; affected versions are not specified.