# CVE-2024-35825: usb: gadget: ncm: Fix handling of zero block length packets

> 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, NVD) `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.34% (percentile 20, 2026-11-26)
- **Published:** 2024-05-17T13:27:28.914Z
- **Modified:** 2026-06-17T07:35:29.597Z

## Who should check

- Anyone running Linux \>= ff3ba016263ee93a1c6209bf5ab1599de7ab1512, \< e2dbfea520e60d58e0c498ba41bde10452257779; \>= e7ca00f35d8a17af1ae19d529193ebc21bfda164, \< a766761d206e7c36d7526e0ae749949d17ca582c; \>= 17c653d4913bbc50d284aa96cf12bfc63e41ee5c, \< ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03; \>= 7014807fb7efa169a47a7a0a0a41d2c513925de0, \< 92b051b87658df7649ffcdef522593f21a2b296b; \>= 49fbc18378ae72a47feabee97fdb86f3cea09765, \< 7664ee8bd80309b90d53488b619764f0a057f2b7; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< a0f77b5d6067285b8eca0ee3bd1e448a6258026f; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< 6b2c73111a252263807b7598682663dc33aa4b4c; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70; 5bdf93a2f5459f944b416b188178ca4a92fd206f; 4bf1a9d20c65b9e80ca4b171267103f8d4f2c61f; …
- Anyone running Linux 6.6

## Description

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

usb: gadget: ncm: Fix handling of zero block length packets

While connecting to a Linux host with CDC\_NCM\_NTB\_DEF\_SIZE\_TX
set to 65536, it has been observed that we receive short packets,
which come at interval of 5-10 seconds sometimes and have block
length zero but still contain 1-2 valid datagrams present.

According to the NCM spec:

"If wBlockLength = 0x0000, the block is terminated by a
short packet. In this case, the USB transfer must still
be shorter than dwNtbInMaxSize or dwNtbOutMaxSize. If
exactly dwNtbInMaxSize or dwNtbOutMaxSize bytes are sent,
and the size is a multiple of wMaxPacketSize for the
given pipe, then no ZLP shall be sent.

wBlockLength= 0x0000 must be used with extreme care, because
of the possibility that the host and device may get out of
sync, and because of test issues.

wBlockLength = 0x0000 allows the sender to reduce latency by
starting to send a very large NTB, and then shortening it when
the sender discovers that there’s not sufficient data to justify
sending a large NTB"

However, there is a potential issue with the current implementation,
as it checks for the occurrence of multiple NTBs in a single
giveback by verifying if the leftover bytes to be processed is zero
or not. If the block length reads zero, we would process the same
NTB infintely because the leftover bytes is never zero and it leads
to a crash. Fix this by bailing out if block length reads zero.

## Affected and fixed versions

- Linux: \>= ff3ba016263ee93a1c6209bf5ab1599de7ab1512, \< e2dbfea520e60d58e0c498ba41bde10452257779; \>= e7ca00f35d8a17af1ae19d529193ebc21bfda164, \< a766761d206e7c36d7526e0ae749949d17ca582c; \>= 17c653d4913bbc50d284aa96cf12bfc63e41ee5c, \< ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03; \>= 7014807fb7efa169a47a7a0a0a41d2c513925de0, \< 92b051b87658df7649ffcdef522593f21a2b296b; \>= 49fbc18378ae72a47feabee97fdb86f3cea09765, \< 7664ee8bd80309b90d53488b619764f0a057f2b7; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< a0f77b5d6067285b8eca0ee3bd1e448a6258026f; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< 6b2c73111a252263807b7598682663dc33aa4b4c; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70; 5bdf93a2f5459f944b416b188178ca4a92fd206f; 4bf1a9d20c65b9e80ca4b171267103f8d4f2c61f; … (cvelist)
- Linux: 6.6 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-35825.md
Affected: Linux >= ff3ba016263ee93a1c6209bf5ab1599de7ab1512, < e2dbfea520e60d58e0c498ba41bde10452257779; >= e7ca00f35d8a17af1ae19d529193ebc21bfda164, < a766761d206e7c36d7526e0ae749949d17ca582c; >= 17c653d4913bbc50d284aa96cf12bfc63e41ee5c, < ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03; >= 7014807fb7efa169a47a7a0…
Fixed in: Linux 92b051b87658df7649ffcdef522593f21a2b296b, Linux 7664ee8bd80309b90d53488b619764f0a057f2b7, Linux 6b2c73111a252263807b7598682663dc33aa4b4c

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-35825 being exploited?

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

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

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

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

Linux \>= ff3ba016263ee93a1c6209bf5ab1599de7ab1512, \< e2dbfea520e60d58e0c498ba41bde10452257779; \>= e7ca00f35d8a17af1ae19d529193ebc21bfda164, \< a766761d206e7c36d7526e0ae749949d17ca582c; \>= 17c653d4913bbc50d284aa96cf12bfc63e41ee5c, \< ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03; \>= 7014807fb7efa169a47a7a0a0a41d2c513925de0, \< 92b051b87658df7649ffcdef522593f21a2b296b; \>= 49fbc18378ae72a47feabee97fdb86f3cea09765, \< 7664ee8bd80309b90d53488b619764f0a057f2b7; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< a0f77b5d6067285b8eca0ee3bd1e448a6258026f; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< 6b2c73111a252263807b7598682663dc33aa4b4c; \>= 427694cfaafa565a3db5c5ea71df6bc095dca92f, \< f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70; 5bdf93a2f5459f944b416b188178ca4a92fd206f; 4bf1a9d20c65b9e80ca4b171267103f8d4f2c61f; …; Linux 6.6.

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

Yes. Fixed in Linux 92b051b87658df7649ffcdef522593f21a2b296b, Linux 7664ee8bd80309b90d53488b619764f0a057f2b7, Linux 6b2c73111a252263807b7598682663dc33aa4b4c. No fix listed yet: follow the vendor advisory.

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

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/e2dbfea520e60d58e0c498ba41bde10452257779>
- patch: <https://git.kernel.org/stable/c/a766761d206e7c36d7526e0ae749949d17ca582c>
- patch: <https://git.kernel.org/stable/c/ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03>
- patch: <https://git.kernel.org/stable/c/92b051b87658df7649ffcdef522593f21a2b296b>
- patch: <https://git.kernel.org/stable/c/7664ee8bd80309b90d53488b619764f0a057f2b7>
- patch: <https://git.kernel.org/stable/c/a0f77b5d6067285b8eca0ee3bd1e448a6258026f>
- patch: <https://git.kernel.org/stable/c/6b2c73111a252263807b7598682663dc33aa4b4c>
- patch: <https://git.kernel.org/stable/c/f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70>
- other: <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html>
- other: <https://lists.debian.org/debian-lts-announce/2024/06/msg00020.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-35825>

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