From 46bb87d3316e81c00f47ce96ba0fdf55f7444764 Mon Sep 17 00:00:00 2001 From: Adttil <2429917001@qq.com> Date: Tue, 16 Dec 2025 11:29:10 +0800 Subject: [PATCH] vdpa: Resolved timing issues during vdpa device release virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDDAJ7 CVE: NA ------------------------------------------------------------------ Fixes: 6a58b8be556f ("vhost/vdpa: Add support to bind and attach iommufd") Adjust the shutdown sequence of VDPA devices to release the IOMMU page table after device reset, preventing abnormal DMA operations from occurring. Signed-off-by: yangtao <2429917001@qq.com> --- drivers/vhost/vdpa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 35e5180b5470..360baefe58f9 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -1683,13 +1683,13 @@ static int vhost_vdpa_release(struct inode *inode, struct file *filep) struct vhost_dev *d = &v->vdev; mutex_lock(&d->mutex); -#if IS_ENABLED(CONFIG_IOMMUFD) - vhost_vdpa_unbind_iommufd(v); -#endif filep->private_data = NULL; vhost_vdpa_clean_irq(v); vhost_vdpa_reset(v, VDPA_DEV_RESET_CLOSE); vhost_dev_stop(&v->vdev); +#if IS_ENABLED(CONFIG_IOMMUFD) + vhost_vdpa_unbind_iommufd(v); +#endif vhost_vdpa_unbind_mm(v); vhost_vdpa_config_put(v); vhost_vdpa_cleanup(v); -- Gitee