Skip to contentSkip to conversation

CVE-2024-40956: dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jul 12, 2024

lore
Share & tools
lore
#0 lore raw

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

dmaengine: idxd: Fix possible Use-After-Free in irq_process_work_list

Use list_for_each_entry_safe() to allow iterating through the list and deleting the entry in the iteration process. The descriptor is freed via idxd_desc_complete() and there's a slight chance may cause issue for the list iterator when the descriptor is reused by another thread without it being deleted from the list.

The Linux kernel CVE team has assigned CVE-2024-40956 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.11 with commit 16e19e11228b and fixed in 5.15.162 with commit 1b08bf5a17c6
	Issue introduced in 5.11 with commit 16e19e11228b and fixed in 6.1.96 with commit 83163667d881
	Issue introduced in 5.11 with commit 16e19e11228b and fixed in 6.6.36 with commit faa35db78b05
	Issue introduced in 5.11 with commit 16e19e11228b and fixed in 6.9.7 with commit a14968921486
	Issue introduced in 5.11 with commit 16e19e11228b and fixed in 6.10-rc5 with commit e3215deca452

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2024-40956

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/dma/idxd/irq.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/1b08bf5a17c66ab7dbb628df5344da53c8e7ab33
	https://git.kernel.org/stable/c/83163667d881100a485b6c2daa30301b7f68d9b5
	https://git.kernel.org/stable/c/faa35db78b058a2ab6e074ee283f69fa398c36a8
	https://git.kernel.org/stable/c/a14968921486793f2a956086895c3793761309dd
	https://git.kernel.org/stable/c/e3215deca4520773cd2b155bed164c12365149a7