iommu/vt-d: drop mm use count if address is not canonical

2019-04-17 Thread Pan Bian
The use count of svm->mm is incremented by mmget_not_zero. However, it is not dropped when the address is not canonical. This patch fixes the bug. Fixes: 9d8c3af31607("iommu/vt-d: IOMMU Page Request needs to check if address is canonical.") Signed-off-by: Pan Bian --- drivers/iomm

[PATCH] iommu: use memunmap to free memremap

2018-11-21 Thread Pan Bian
memunmap() should be used to free the return of memremap(), not iounmap(). Fixes: dfddb969edf0("iommu/vt-d: Switch from ioremap_cache to memremap") Signed-off-by: Pan Bian --- drivers/iommu/intel-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i

[PATCH 1/1] iommu/amd: fix incorrect error handling

2017-04-23 Thread Pan Bian
From: Pan Bian In function amd_iommu_bind_pasid(), the control flow jumps to label out_free when pasid_state->mm and mm is NULL. And mmput(mm) is called. In function mmput(mm), mm is referenced without validation. This will result in a NULL dereference bug. This patch fixes the bug. Signed-