On Mon, Oct 05, 2026 at 08:00:07AM -0700, Rob Clark wrote: > On Sat, Aug 22, 2026 at 2:08 AM <[email protected]> wrote: > > > > Thank you for your contribution! Sashiko AI review found 2 potential > > issue(s) to consider: > > > > Pre-existing issues: > > - [High] Sleeping in atomic context > > - [High] Deferred teardown TOCTOU race via flink name re-opening causing > > IOVA Use-After-Free > > -- > > > > > > drivers/gpu/drm/msm/msm_gem.c:put_iova_spaces_locked() { > > ... > > drm_gpuvm_bo_for_each_va_safe (vma, vmatmp, vm_bo) { > > msm_gem_vma_unmap(vma, reason); > > if (close) > > msm_gem_vma_close(vma); > > } > > } > > > > Will this destroy Thread B's mapping while its job is running, freeing the > > IOVA for immediate reuse? > > > > [Severity: High] > > This isn't a bug introduced by this patch, but does adding these blocking > > calls cause a scheduling while atomic panic when tearing down a writeback > > connector? > > > > The drm core function drm_writeback_connector_cleanup() holds a spinlock > > with > > IRQs disabled when tearing down pending jobs: > > > > drivers/gpu/drm/drm_writeback.c:drm_writeback_connector_cleanup() { > > spin_lock_irqsave(&wb_connector->job_lock, flags); > > list_for_each_entry_safe(pos, n, &wb_connector->job_queue, list_entry) { > > list_del(&pos->list_entry); > > drm_writeback_cleanup_job(pos); > > } > > } > > Hmm, someone should look at this.. maybe we could move to an on-stack > list under a lock, and then do cleanup outside of the lock?
FWIW, the fix is implemented at [1]. Would it be reasonable to pick it together with this series? [1] https://patch.msgid.link/[email protected] -- With best wishes Dmitry
