CVE-2024-35825 json
usb: gadget: ncm: Fix handling of zero block length packets
published 2024-05-17 2 y ago modified 2026-06-17 4 mo ago also EUVD-2024-35809
- cvss
- 5.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 14%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 4.15, 4.19.312, 5.4.274, 5.10.215, 5.15.154, 6.1.84, 6.6, 6.6.24, 6.7.12, 6.8
- linux Debian 12 6.1.85-1
- linux Debian 14, Debian 13 6.7.12-1
debian advisories DEBIAN-CVE-2024-35825
- linux Ubuntu 20.04 LTS 5.4.0-189.209
- linux Ubuntu 22.04 LTS 5.15.0-116.126
- linux-aws Ubuntu 20.04 LTS 5.4.0-1128.138
- linux-aws Ubuntu 22.04 LTS 5.15.0-1065.71
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1132.141
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1064.72
- linux-gke Ubuntu 22.04 LTS 5.15.0-1062.68
- linux-ibm Ubuntu 20.04 LTS 5.4.0-1075.80
ubuntu advisories UBUNTU-CVE-2024-35825
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-source-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-25.1
- kernel-livepatch-MICRO-6-0-RT_Update_5 Linux Micro 6.1, Linux Micro 6.0 1-1.1
- kernel-rt Linux Micro 6.0 6.4.0-9.1
- kernel-source-rt Linux Micro 6.0 6.4.0-9.1
- kernel-source Linux Micro 6.0 6.4.0-18.1
- kernel-default Linux Micro 6.0 6.4.0-18.1
- kernel-kvmsmall Linux Micro 6.0 6.4.0-18.1
suse advisories SUSE-SU-2025:20166-1SUSE-SU-2025:20249-1SUSE-SU-2025:20028-1SUSE-SU-2025:20008-1SUSE-SU-2024:2973-1SUSE-SU-2024:2203-1
- git.kernel.org/stable/c/e2dbfea520e60d58e0c498ba41bde10452257779 commit
- git.kernel.org/stable/c/a766761d206e7c36d7526e0ae749949d17ca582c commit
- git.kernel.org/stable/c/ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03 commit
- git.kernel.org/stable/c/92b051b87658df7649ffcdef522593f21a2b296b commit
- git.kernel.org/stable/c/7664ee8bd80309b90d53488b619764f0a057f2b7 commit
- git.kernel.org/stable/c/a0f77b5d6067285b8eca0ee3bd1e448a6258026f commit
- git.kernel.org/stable/c/6b2c73111a252263807b7598682663dc33aa4b4c commit
- git.kernel.org/stable/c/f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2024-35825 updated cvss 5.5
kernel: usb: gadget: ncm: Fix handling of zero block length packets
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.23% chance of exploitation in the next 30 days, higher than 14% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
Classification
- Technology feeds
References
-
git.kernel.org
/stable/c/e2dbfea520e60d58e0c498ba41bde10452257779
patch
-
git.kernel.org
/stable/c/a766761d206e7c36d7526e0ae749949d17ca582c
patch
-
git.kernel.org
/stable/c/ef846cdbd100f7f9dc045e8bcd7fe4b3a3713c03
patch
-
git.kernel.org
/stable/c/92b051b87658df7649ffcdef522593f21a2b296b
patch
-
git.kernel.org
/stable/c/7664ee8bd80309b90d53488b619764f0a057f2b7
patch
-
git.kernel.org
/stable/c/a0f77b5d6067285b8eca0ee3bd1e448a6258026f
patch
-
git.kernel.org
/stable/c/6b2c73111a252263807b7598682663dc33aa4b4c
patch
-
git.kernel.org
/stable/c/f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70
patch
-
lists.debian.org
/debian-lts-announce/2024/06/msg00017.html
third-party-advisory
-
lists.debian.org
/debian-lts-announce/2024/06/msg00020.html
third-party-advisory
Sources
- CVE List CVE-2024-35825
- NVD CVE-2024-35825
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.