Commit c64d8815 authored by Keqian Zhu's avatar Keqian Zhu Committed by Zheng Zengkai
Browse files

vfio/iommu_type1: Fix some sanity checks in detach group



stable inclusion
from stable-5.10.20
commit c0e73c1d6d9186ab861e3d461a77836071cff990
bugzilla: 50608

--------------------------------

[ Upstream commit 4a19f37a ]

vfio_sanity_check_pfn_list() is used to check whether pfn_list and
notifier are empty when remove the external domain, so it makes a
wrong assumption that only external domain will use the pinning
interface.

Now we apply the pfn_list check when a vfio_dma is removed and apply
the notifier check when all domains are removed.

Fixes: a54eb550 ("vfio iommu type1: Add support for mediated devices")
Signed-off-by: default avatarKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 3eb322ac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment