linux-yocto/drivers/dma/idxd
Harshit Mogalapalli bc952bf4e0 dmaengine: idxd: Fix passing freed memory in idxd_cdev_open()
commit 0642287e3e upstream.

Smatch warns:
	drivers/dma/idxd/cdev.c:327:
		idxd_cdev_open() warn: 'sva' was already freed.

When idxd_wq_set_pasid() fails, the current code unbinds sva and then
goes to 'failed_set_pasid' where iommu_sva_unbind_device is called
again causing the above warning.
[ device_user_pasid_enabled(idxd) is still true when calling
failed_set_pasid ]

Fix this by removing additional unbind when idxd_wq_set_pasid() fails

Fixes: b022f59725 ("dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230509060716.2830630-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-04 14:40:22 +02:00
..
bus.c
cdev.c dmaengine: idxd: Fix passing freed memory in idxd_cdev_open() 2025-06-04 14:40:22 +02:00
compat.c
device.c
dma.c
idxd.h dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling 2025-06-04 14:40:19 +02:00
init.c dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling 2025-06-04 14:40:19 +02:00
irq.c dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list 2024-06-27 13:46:20 +02:00
Makefile
perfmon.c dmaengine: idxd: Fix oops during rmmod on single-CPU platforms 2024-05-02 16:29:31 +02:00
perfmon.h
registers.h VFIO: Add the SPR_DSA and SPR_IAX devices to the denylist 2024-05-17 11:56:23 +02:00
submit.c
sysfs.c dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling 2025-06-04 14:40:19 +02:00