CVE-2026-80698: dmaengine: idxd: fix double free of wq, engine, and group structs
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
dmaengine: idxd: fix double free of wq, engine, and group structs
The release callbacks for wq, engine, and group devices (idxd_conf_wq_release, idxd_conf_engine_release, idxd_conf_group_release) each call kfree() on the enclosing struct. The setup error paths and cleanup functions also call kfree() explicitly after put_device(), producing a double free whenever put_device() drops the reference count to zero and fires the release.
In the setup functions, device_initialize() is called before device_add(), so the reference count is exactly 1 at the error sites. put_device() unconditionally fires the release, which frees the struct; the subsequent explicit kfree() then operates on freed memory.
For idxd_setup_wqs(), the wq release callback also owns opcap_bmap and wqcfg. The error unwind additionally freed those fields explicitly before calling put_device(), causing further double frees on both.
Remove the redundant explicit kfree() calls from all setup error paths and cleanup functions for wq, engine, and group structs, delegating sole ownership of those allocations to the release callbacks.
The Linux kernel CVE team has assigned CVE-2026-80698 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.13 with commit 7c5dd23e57c14cf7177b8a5e0fd08916e0c60005 and fixed in 7.1.8 with commit c93a9f652b7373ac8ee5bfcc18a9af76959b6c6c Issue introduced in 5.13 with commit 7c5dd23e57c14cf7177b8a5e0fd08916e0c60005 and fixed in 7.2 with commit ec2d428b2e32dd157de8f86a86dd85c5b2c8f45c Issue introduced in 5.11.22 with commit 394e179f51fce06d6bb8ca5af8fa53f33c718cf4 Issue introduced in 5.12.5 with commit b09ad63775f58a8de3e228f59fb9543bfd964c9c Issue introduced in 5.11.22 with commit 26c219e7522c494f7865a928c81ced84cc7db3ae Issue introduced in 5.12.5 with commit 35ea8721d9e6e74c6847cf4d6c27e883b00b0331 Issue introduced in 5.11.22 with commit e6f86fe368cdc14764833a6e8bb59f7a85a40e06 Issue introduced in 5.12.5 with commit 1c28fd5f94d8996f7dd3805bd6a16ed46a5d0886
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-2026-80698
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/init.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/c93a9f652b7373ac8ee5bfcc18a9af76959b6c6c https://git.kernel.org/stable/c/ec2d428b2e32dd157de8f86a86dd85c5b2c8f45c