Re: CVE-2024-26628: drm/amdkfd: Fix lock dependency warning

From: Michal Hocko
Date: Fri Mar 08 2024 - 07:50:44 EST


On Wed 06-03-24 06:46:11, Greg KH wrote:
[...]
> Possible unsafe locking scenario:
>
> CPU0 CPU1
> ---- ----
> lock(&svms->lock);
> lock(&mm->mmap_lock);
> lock(&svms->lock);
> lock((work_completion)(&svm_bo->eviction_work));
>
> I believe this cannot really lead to a deadlock in practice, because
> svm_range_evict_svm_bo_worker only takes the mmap_read_lock if the BO
> refcount is non-0. That means it's impossible that svm_range_bo_release
> is running concurrently. However, there is no good way to annotate this.

OK, so is this even a bug (not to mention a security/weakness)?
--
Michal Hocko
SUSE Labs