Skip to content

Commit fb5de16

Browse files
committed
dmaengine: idxd: Avoid unnecessary destruction of file_ida
jira LE-2157 cve CVE-2024-38629 Rebuild_History Non-Buildable kernel-5.14.0-503.14.1.el9_5 commit-author Fenghua Yu <[email protected]> commit 76e43fa 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: e6fd6d7 ("dmaengine: idxd: add a device to represent the file opened") Signed-off-by: Lijun Pan <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> (cherry picked from commit 76e43fa) Signed-off-by: Jonathan Maple <[email protected]>
1 parent ee478e9 commit fb5de16

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/dma/idxd/cdev.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,6 @@ void idxd_wq_del_cdev(struct idxd_wq *wq)
577577
struct idxd_cdev *idxd_cdev;
578578

579579
idxd_cdev = wq->idxd_cdev;
580-
ida_destroy(&file_ida);
581580
wq->idxd_cdev = NULL;
582581
cdev_device_del(&idxd_cdev->cdev, cdev_dev(idxd_cdev));
583582
put_device(cdev_dev(idxd_cdev));

0 commit comments

Comments
 (0)