CVE-2021-47436

See a problem?
Source
https://nvd.nist.gov/vuln/detail/CVE-2021-47436
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-47436.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-47436
Related
Published
2024-05-22T07:15:08Z
Modified
2024-09-18T03:17:27.898617Z
Summary
[none]
Details

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

usb: musb: dsps: Fix the probe error path

Commit 7c75bde329d7 ("usb: musb: musbdsps: requestirq() after initializing musb") has inverted the calls to dspssetupoptionalvbusirq() and dspscreatemusbpdev() without updating correctly the error path. dspscreatemusbpdev() allocates and registers a new platform device which must be unregistered and freed with platformdeviceunregister(), and this is missing upon dspssetupoptionalvbusirq() error.

While on the master branch it seems not to trigger any issue, I observed a kernel crash because of a NULL pointer dereference with a v5.10.70 stable kernel where the patch mentioned above was backported. With this kernel version, -EPROBEDEFER is returned the first time dspssetupoptionalvbus_irq() is called which triggers the probe to error out without unregistering the platform device. Unfortunately, on the Beagle Bone Black Wireless, the platform device still living in the system is being used by the USB Ethernet gadget driver, which during the boot phase triggers the crash.

My limited knowledge of the musb world prevents me to revert this commit which was sent to silence a robot warning which, as far as I understand, does not make sense. The goal of this patch was to prevent an IRQ to fire before the platform device being registered. I think this cannot ever happen due to the fact that enabling the interrupts is done by the ->enable() callback of the platform musb device, and this platform device must be already registered in order for the core or any other user to use this callback.

Hence, I decided to fix the error path, which might prevent future errors on mainline kernels while also fixing older ones.

References

Affected packages

Debian:11 / 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
5.10.84-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

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
5.14.16-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
5.14.16-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}