[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220517185845.GL63055@ziepe.ca>
Date: Tue, 17 May 2022 15:58:45 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Wan Jiabing <wanjiabing@...o.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Alex Williamson <alex.williamson@...hat.com>,
Yi Liu <yi.l.liu@...el.com>, Kevin Tian <kevin.tian@...el.com>,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm/vfio: Fix potential deadlock problem in vfio
On Tue, May 17, 2022 at 10:34:41AM +0800, Wan Jiabing wrote:
> Fix following coccicheck warning:
> ./virt/kvm/vfio.c:258:1-7: preceding lock on line 236
>
> If kvm_vfio_file_iommu_group() failed, code would goto err_fdput with
> mutex_lock acquired and then return ret. It might cause potential
> deadlock. Move mutex_unlock bellow err_fdput tag to fix it.
>
> Fixes: d55d9e7a45721 ("kvm/vfio: Store the struct file in the kvm_vfio_group")
> Signed-off-by: Wan Jiabing <wanjiabing@...o.com>
> ---
> virt/kvm/vfio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Thanks,
Jason
Powered by blists - more mailing lists