diff options
| author | Gyeyoung Baek <gye976@gmail.com> | 2026-11-01 16:37:00 +0900 |
|---|---|---|
| committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2026-11-16 11:19:51 +0100 |
| commit | c3fe8795ecd844d0bf76102217bec01cce01b715 (patch) | |
| tree | 76bd64e4f77e8146a579b5f06389aa1399b68f83 /rust/kernel/alloc/kvec/errors.rs | |
| parent | 4d8cb7be620e969e4189cc209f2338b6a77c80fd (diff) | |
accel/rocket: Fix drm_mm UAF on close vs in-flight job
The drm_mm and its mutex live in rocket_file_priv, which
rocket_postclose() frees on fd close. But a BO held by an
in-flight job is only freed after close, from the drm_sched
free_job worker, and its destructor then accesses the already
freed drm_mm and mutex.
BUG: KASAN: slab-use-after-free in __mutex_trylock_common+0x90/0x1e8
Workqueue: <NPU>.npu drm_sched_free_job_work [gpu_sched]
Call trace:
__mutex_lock
rocket_gem_bo_free
rocket_job_cleanup
rocket_job_free
drm_sched_free_job_work [gpu_sched]
Move drm_mm and the mutex out of rocket_file_priv into the
kref-managed rocket_iommu_domain (renamed to rocket_vm). Their
lifetime now matches the vm's: as long as a BO or job references
the vm, the address-space state stays alive.
Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation")
Cc: stable@vger.kernel.org
Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
[tomeu: Rebased on the BO creation error path fix]
[tomeu: Fixes points at the commit that added the drm_mm to rocket_file_priv]
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://patch.msgid.link/20261101073700.1261966-1-gye976@gmail.com
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions
