linux/drivers/dma/idxd
Fenghua Yu 9eb15f24a0 dmaengine: idxd: Avoid unnecessary destruction of file_ida
[ Upstream commit 76e43fa6a4 ]

file_ida is allocated during cdev open and is freed accordingly
during cdev release. This sequence is guaranteed by driver file
operations. Therefore, there is no need to destroy an already empty
file_ida when the WQ cdev is removed.

Worse, ida_free() in cdev release may happen after destruction of
file_ida per WQ cdev. This can lead to accessing an id in file_ida
after it has been destroyed, resulting in a kernel panic.

Remove ida_destroy(&file_ida) to address these issues.

Fixes: e6fd6d7e5f ("dmaengine: idxd: add a device to represent the file opened")
Signed-off-by: Lijun Pan <lijun.pan@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20240130013954.2024231-1-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-06-12 11:12:25 +02:00
..
bus.c Bus: Make remove callback return void tag 2021-07-27 19:12:14 +05:30
cdev.c dmaengine: idxd: Avoid unnecessary destruction of file_ida 2024-06-12 11:12:25 +02:00
compat.c dmaengine: idxd: use const struct bus_type * 2023-03-23 13:21:42 +01:00
debugfs.c dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue 2024-05-02 16:32:48 +02:00
device.c dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue 2024-05-02 16:32:48 +02:00
dma.c dmaengine/idxd: Re-enable kernel workqueue under DMA API 2023-08-09 17:44:39 +02:00
idxd.h dmaengine: idxd: add a new security check to deal with a hardware erratum 2024-05-17 12:02:38 +02:00
init.c dmaengine: idxd: add a new security check to deal with a hardware erratum 2024-05-17 12:02:38 +02:00
irq.c dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue 2024-05-02 16:32:48 +02:00
Makefile dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers 2023-11-20 11:59:25 +01:00
perfmon.c dmaengine: idxd: Fix oops during rmmod on single-CPU platforms 2024-05-02 16:32:48 +02:00
perfmon.h dmaengine: idxd: Add IDXD performance monitor support 2021-04-25 21:46:12 +05:30
registers.h VFIO: Add the SPR_DSA and SPR_IAX devices to the denylist 2024-05-17 12:02:38 +02:00
submit.c dmaengine: idxd: Protect int_handle field in hw descriptor 2024-01-10 17:16:59 +01:00
sysfs.c dmaengine: idxd: add a write() method for applications to submit work 2024-05-17 12:02:39 +02:00