# CVE-2024-56687: usb: musb: Fix hardware lockup on first Rx endpoint request

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-28)
- **CWE:** CWE-667
- **Published:** 2024-12-28T09:46:14.197Z
- **Modified:** 2026-06-17T08:12:44.607Z

## Who should check

- Anyone running Linux \>= baebdf48c360080710f80699eea3affbb13d6c65, \< c749500b28cae67410792096133ee7f282439c51; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 5906ee3693674d734177df13a519a21bb03f730d; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< f05ad9755bb294328c3d0f429164ac6d4d08c548; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 0c89445e6d475b78d37b64ae520831cd43af7db4; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 3fc137386c4620305bbc2a216868c53f9245670a
- Anyone running Linux 5.18

## Description

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

usb: musb: Fix hardware lockup on first Rx endpoint request

There is a possibility that a request's callback could be invoked from
usb\_ep\_queue() (call trace below, supplemented with missing calls):

req-\>complete from usb\_gadget\_giveback\_request
	(drivers/usb/gadget/udc/core.c:999)
usb\_gadget\_giveback\_request from musb\_g\_giveback
	(drivers/usb/musb/musb\_gadget.c:147)
musb\_g\_giveback from rxstate
	(drivers/usb/musb/musb\_gadget.c:784)
rxstate from musb\_ep\_restart
	(drivers/usb/musb/musb\_gadget.c:1169)
musb\_ep\_restart from musb\_ep\_restart\_resume\_work
	(drivers/usb/musb/musb\_gadget.c:1176)
musb\_ep\_restart\_resume\_work from musb\_queue\_resume\_work
	(drivers/usb/musb/musb\_core.c:2279)
musb\_queue\_resume\_work from musb\_gadget\_queue
	(drivers/usb/musb/musb\_gadget.c:1241)
musb\_gadget\_queue from usb\_ep\_queue
	(drivers/usb/gadget/udc/core.c:300)

According to the docstring of usb\_ep\_queue(), this should not happen:

"Note that @req's -\>complete() callback must never be called from within
usb\_ep\_queue() as that can create deadlock situations."

In fact, a hardware lockup might occur in the following sequence:

1. The gadget is initialized using musb\_gadget\_enable().
2. Meanwhile, a packet arrives, and the RXPKTRDY flag is set, raising an
   interrupt.
3. If IRQs are enabled, the interrupt is handled, but musb\_g\_rx() finds an
   empty queue (next\_request() returns NULL). The interrupt flag has
   already been cleared by the glue layer handler, but the RXPKTRDY flag
   remains set.
4. The first request is enqueued using usb\_ep\_queue(), leading to the call
   of req-\>complete(), as shown in the call trace above.
5. If the callback enables IRQs and another packet is waiting, step (3)
   repeats. The request queue is empty because usb\_g\_giveback() removes the
   request before invoking the callback.
6. The endpoint remains locked up, as the interrupt triggered by hardware
   setting the RXPKTRDY flag has been handled, but the flag itself remains
   set.

For this scenario to occur, it is only necessary for IRQs to be enabled at
some point during the complete callback. This happens with the USB Ethernet
gadget, whose rx\_complete() callback calls netif\_rx(). If called in the
task context, netif\_rx() disables the bottom halves (BHs). When the BHs are
re-enabled, IRQs are also enabled to allow soft IRQs to be processed. The
gadget itself is initialized at module load (or at boot if built-in), but
the first request is enqueued when the network interface is brought up,
triggering rx\_complete() in the task context via ioctl(). If a packet
arrives while the interface is down, it can prevent the interface from
receiving any further packets from the USB host.

The situation is quite complicated with many parties involved. This
particular issue can be resolved in several possible ways:

1. Ensure that callbacks never enable IRQs. This would be difficult to
   enforce, as discovering how netif\_rx() interacts with interrupts was
   already quite challenging and u\_ether is not the only function driver.
   Similar "bugs" could be hidden in other drivers as well.
2. Disable MUSB interrupts in musb\_g\_giveback() before calling the callback
   and re-enable them afterwars (by calling musb\_{dis,en}able\_interrupts(),
   for example). This would ensure that MUSB interrupts are not handled
   during the callback, even if IRQs are enabled. In fact, it would allow
   IRQs to be enabled when releasing the lock. However, this feels like an
   inelegant hack.
3. Modify the interrupt handler to clear the RXPKTRDY flag if the request
   queue is empty. While this approach also feels like a hack, it wastes
   CPU time by attempting to handle incoming packets when the software is
   not ready to process them.
4. Flush the Rx FIFO instead of calling rxstate() in musb\_ep\_restart().
   This ensures that the hardware can receive packets when there is at
   least one request in the queue. Once I
---truncated---

## Affected and fixed versions

- Linux: \>= baebdf48c360080710f80699eea3affbb13d6c65, \< c749500b28cae67410792096133ee7f282439c51; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 5906ee3693674d734177df13a519a21bb03f730d; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< f05ad9755bb294328c3d0f429164ac6d4d08c548; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 0c89445e6d475b78d37b64ae520831cd43af7db4; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 3fc137386c4620305bbc2a216868c53f9245670a (cvelist)
- Linux: 5.18 (cvelist)

## Mitigation

- Upgrade Linux to 3fc137386c4620305bbc2a216868c53f9245670a or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-56687. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-56687.md
Affected: Linux >= baebdf48c360080710f80699eea3affbb13d6c65, < c749500b28cae67410792096133ee7f282439c51; >= baebdf48c360080710f80699eea3affbb13d6c65, < 5906ee3693674d734177df13a519a21bb03f730d; >= baebdf48c360080710f80699eea3affbb13d6c65, < f05ad9755bb294328c3d0f429164ac6d4d08c548; >= baebdf48c360080710f8069…
Fixed in: Linux 5906ee3693674d734177df13a519a21bb03f730d, Linux 0c89445e6d475b78d37b64ae520831cd43af7db4, Linux 3fc137386c4620305bbc2a216868c53f9245670a

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-56687 being exploited?

There is no confirmed exploitation: CVE-2024-56687 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2024-56687?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-56687?

Linux \>= baebdf48c360080710f80699eea3affbb13d6c65, \< c749500b28cae67410792096133ee7f282439c51; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 5906ee3693674d734177df13a519a21bb03f730d; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< f05ad9755bb294328c3d0f429164ac6d4d08c548; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 0c89445e6d475b78d37b64ae520831cd43af7db4; \>= baebdf48c360080710f80699eea3affbb13d6c65, \< 3fc137386c4620305bbc2a216868c53f9245670a; Linux 5.18.

### Is there a fix for CVE-2024-56687?

Yes. Fixed in Linux 5906ee3693674d734177df13a519a21bb03f730d, Linux 0c89445e6d475b78d37b64ae520831cd43af7db4, Linux 3fc137386c4620305bbc2a216868c53f9245670a. Upgrade Linux to 3fc137386c4620305bbc2a216868c53f9245670a or later.

### How do I check if I'm affected by CVE-2024-56687?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/c749500b28cae67410792096133ee7f282439c51>
- patch: <https://git.kernel.org/stable/c/5906ee3693674d734177df13a519a21bb03f730d>
- patch: <https://git.kernel.org/stable/c/f05ad9755bb294328c3d0f429164ac6d4d08c548>
- patch: <https://git.kernel.org/stable/c/0c89445e6d475b78d37b64ae520831cd43af7db4>
- patch: <https://git.kernel.org/stable/c/3fc137386c4620305bbc2a216868c53f9245670a>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-56687>

HTML: <https://flawdb.com/CVE-2024-56687> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-56687>
