Bug 1226905 (CVE-2024-38629)

Summary: VUL-0: CVE-2024-38629: kernel: dmaengine: idxd: avoid unnecessary destruction of file_ida
Product: [Novell Products] SUSE Security Incidents Reporter: SMASH SMASH <smash_bz>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: RESOLVED FIXED QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: camila.matos, mhocko
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/411766/
Whiteboard: CVSSv3.1:SUSE:CVE-2024-38629:5.5:(AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H)
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description SMASH SMASH 2024-06-24 13:42:12 UTC
In the Linux kernel, the following vulnerability has been resolved:

dmaengine: idxd: Avoid unnecessary destruction of file_ida

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.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2024-38629
https://www.cve.org/CVERecord?id=CVE-2024-38629
https://git.kernel.org/stable/c/15edb906211bf53e7b5574f7326ab734d6bff4f9
https://git.kernel.org/stable/c/76e43fa6a456787bad31b8d0daeabda27351a480
https://git.kernel.org/stable/c/9eb15f24a0b9b017b39cde8b8c07243676b63687
https://git.kernel.org/pub/scm/linux/security/vulns.git/plain/cve/published/2024/CVE-2024-38629.mbox
https://bugzilla.redhat.com/show_bug.cgi?id=2293698