CVE-2022-48868

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48868
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48868.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48868
Related
Published
2024-08-21T07:15:04Z
Modified
2024-09-18T01:00:21Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

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 drvenablewq() 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)

idxddmaenginedrvprobe() -> drvenablewq() -> idxdwqrequestirq(): In above flow, if idxdwqrequestirq() fails then idxdwqunmapportal() is called on error exit path, but drvenablewq() returns 0 because idxdwqdisable() succeeds. The driver is thus loaded successfully.

idxddmaenginedrvremove()->drvdisablewq()->idxdwqunmapportal() Above flow on driver unload triggers the WARN in devmiounmap() because the device resource has already been removed during error path of drvenable_wq().

(b)

idxddmaenginedrvprobe() -> drvenablewq() -> idxdwqrequestirq(): In above flow, if idxdwqrequestirq() fails then idxdwqinitpercpuref() is never called to initialize the percpu counter, yet the driver loads successfully because drvenable_wq() returns 0.

idxddmaenginedrvremove()->idxdwqquiesce()->percpuref_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 drvenablewq() 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.

References

Affected packages

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.1.8-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.1.8-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}