In the Linux kernel, the following vulnerability has been resolved:
dmaengine: idxd: Avoid unnecessary destruction of file_ida
fileida 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 fileida when the WQ cdev is removed.
Worse, idafree() in cdev release may happen after destruction of fileida per WQ cdev. This can lead to accessing an id in file_ida after it has been destroyed, resulting in a kernel panic.
Remove idadestroy(&fileida) to address these issues.