Vulnerability · Published Aug 21, 2024 · Assigned by Linux

CVE-2022-48868dmaengine: idxd: Let probe fail when workqueue cannot be enabled

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 15% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 85.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: dmaengine: idxd: Let probe fail when workqueue cannot be enabled The workqueue is enabled when the appropriate driver is loaded and disabled when the driver is removed. When the driver is removed it assumes that the workqueue was enabled successfully and proceeds to free allocations made during workqueue enabling. Failure during workqueue enabling does not prevent the driver from being loaded. This is because the error path within drv_enable_wq() returns success unless a second failure is encountered during the error path. By returning success it is possible to load the driver even if the workqueue cannot be enabled and allocations that do not exist are attempted to be freed during driver remove. Some examples of problematic flows: (a) idxd_dmaengine_drv_probe() -> drv_enable_wq() -> idxd_wq_request_irq(): In above flow, if idxd_wq_request_irq() fails then idxd_wq_unmap_portal() is called on error exit path, but drv_enable_wq() returns 0 because idxd_wq_disable() succeeds. The driver is thus loaded successfully. idxd_dmaengine_drv_remove()->drv_disable_wq()->idxd_wq_unmap_portal() Above flow on driver unload triggers the WARN in devm_iounmap() because the device resource has already been removed during error path of drv_enable_wq(). (b) idxd_dmaengine_drv_probe() -> drv_enable_wq() -> idxd_wq_request_irq(): In above flow, if idxd_wq_request_irq() fails then idxd_wq_init_percpu_ref() is never called to initialize the percpu counter, yet the driver loads successfully because drv_enable_wq() returns 0. idxd_dmaengine_drv_remove()->__idxd_wq_quiesce()->percpu_ref_kill(): Above flow on driver unload triggers a BUG when attempting to drop the initial ref of the uninitialized percpu ref: BUG: kernel NULL pointer dereference, address: 0000000000000010 Fix the drv_enable_wq() error path by returning the original error that indicates failure of workqueue enabling. This ensures that the probe fails when an error is encountered and the driver remove paths are only attempted when the workqueue was enabled successfully.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.8-1DEBIAN-CVE-2022-48868
Debian:13linux6.1.8-1DEBIAN-CVE-2022-48868
Debian:14linux6.1.8-1DEBIAN-CVE-2022-48868
Ubuntu:22.04:LTSlinux5.15.0-70.77UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-aws5.15.0-1034.38UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure5.15.0-1036.43UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1036.43.1UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-gcp5.15.0-1032.40UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-gke5.15.0-1031.36UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1018.23UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-ibm5.15.0-1028.31UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1028.33UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-kvm5.15.0-1031.36UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-70.77UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1023.23UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-oracle5.15.0-1033.39UBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-raspi5.15.0-1027.29UBUNTU-CVE-2022-48868
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2022-48868
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2022-48868

Affected products (as reported)

VendorProductVersions
Linux Linux 1f2bb40337f0df1d9af80793e9fdacff7706e654 – before 0f150134dd795ffcd60b798a85ab737d8d010fb71f2bb40337f0df1d9af80793e9fdacff7706e654 – before 99dc4520b74e7ca8e9dc9abe37a0b10b494679601f2bb40337f0df1d9af80793e9fdacff7706e654 – before b51b75f0604f17c0f6f3b6f68f1a521a5cc6b04f
Linux Linux 5.15

References