Advisory

UBUNTU-CVE-2021-47272

Also known as: CVE-2021-47272

Summary

The record has no summary.

Details

In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: gadget: Bail from dwc3_gadget_exit() if dwc->gadget is NULL There exists a possible scenario in which dwc3_gadget_init() can fail: during during host -> peripheral mode switch in dwc3_set_mode(), and a pending gadget driver fails to bind. Then, if the DRD undergoes another mode switch from peripheral->host the resulting dwc3_gadget_exit() will attempt to reference an invalid and dangling dwc->gadget pointer as well as call dma_free_coherent() on unmapped DMA pointers. The exact scenario can be reproduced as follows: - Start DWC3 in peripheral mode - Configure ConfigFS gadget with FunctionFS instance (or use g_ffs) - Run FunctionFS userspace application (open EPs, write descriptors, etc) - Bind gadget driver to DWC3's UDC - Switch DWC3 to host mode => dwc3_gadget_exit() is called. usb_del_gadget() will put the ConfigFS driver instance on the gadget_driver_pending_list - Stop FunctionFS application (closes the ep files) - Switch DWC3 to peripheral mode => dwc3_gadget_init() fails as usb_add_gadget() calls check_pending_gadget_drivers() and attempts to rebind the UDC to the ConfigFS gadget but fails with -19 (-ENODEV) because the FFS instance is not in FFS_ACTIVE state (userspace has not re-opened and written the descriptors yet, i.e. desc_ready!=0). - Switch DWC3 back to host mode => dwc3_gadget_exit() is called again, but this time dwc->gadget is invalid. Although it can be argued that userspace should take responsibility for ensuring that the FunctionFS application be ready prior to allowing the composite driver bind to the UDC, failure to do so should not result in a panic from the kernel driver. Fix this by setting dwc->gadget to NULL in the failure path of dwc3_gadget_init() and add a check to dwc3_gadget_exit() to bail out unless the gadget pointer is valid.

Severity

Medium Basis: CVSS v3 score 5.5, vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2024-05-21 15:15 UTC
Modified
2025-10-24 04:51 UTC

Affected packages and fixes

64 affected packages; affected: introduced 0
PackageSystemFix
linux-hwe-edgeDebian packages (deb) · Ubuntu 16.04No fixed version is listed.
linux-aws-5.0Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-aws-5.3Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-azureDebian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-azure-5.3Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-azure-edgeDebian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-gcpDebian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-gcp-5.3Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-gke-4.15Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-gke-5.4Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-gkeop-5.4Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-hweDebian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-hwe-edgeDebian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-oemDebian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-oracle-5.0Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-oracle-5.3Debian packages (deb) · Ubuntu 18.04No fixed version is listed.
linux-aws-5.11Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-aws-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-aws-5.8Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-azure-5.11Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-azure-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-azure-5.8Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-azure-fdeDebian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-gcp-5.11Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-gcp-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-gcp-5.8Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-gkeDebian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-gke-5.15Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-hwe-5.11Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-hwe-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-hwe-5.8Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-intel-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oem-5.10Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oem-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oem-5.14Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oem-5.6Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oracle-5.11Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oracle-5.13Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-oracle-5.8Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-raspi2Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-riscvDebian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-riscv-5.11Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-riscv-5.8Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
linux-allwinner-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-aws-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-aws-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-azure-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-azure-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-azure-fde-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-azure-fde-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-gcp-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-gcp-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-hwe-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-hwe-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-lowlatency-hwe-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-lowlatency-hwe-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-nvidia-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-oem-5.17Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-oem-6.0Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-oem-6.1Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-riscvDebian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-riscv-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-starfive-5.19Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
linux-starfive-6.2Debian packages (deb) · Ubuntu 22.04No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Ubuntu Security Notices · CC BY-SA 4.0

Sources & licences