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

Published May 17, 2024
·
Updated

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 CDCNCMNTBDEFSIZETX 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 Software

21 affected componentsFixes available
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
Linux Linux kernel>=4.14.328<4.15
Linux Linux kernel>=4.19.297<4.19.312
Linux Linux kernel>=5.4.259<5.4.274
Linux Linux kernel>=5.10.199<5.10.215
Linux Linux kernel>=5.15.136<5.15.154
Linux Linux kernel>=6.1.59<6.1.84
Linux Linux kernel>=6.5.8<6.6
Linux Linux kernel>=6.6.1<6.6.24
Linux Linux kernel>=6.7<6.7.12
Linux Linux kernel=6.6
Linux Linux kernel=6.6-rc6
Linux Linux kernel=6.6-rc7
Linux Linux kernel=6.8-rc1
Linux Linux kernel=6.8-rc2
Linux Linux kernel=6.8-rc3
Linux Linux kernel=6.8-rc4
Linux Linux kernel=6.8-rc5
Linux Linux kernel=6.8-rc6
Linux Linux kernel=6.8-rc7
Debian Debian Linux=10.0

Event History

May 17, 2024
CVE Published
via MITRE·01:27 PM
Data Sourced
via MITRE·01:27 PM
Description
Data Sourced
via NVD·02:15 PM
Description
Data Sourced
via NVD·02:15 PM
RemedySeverityAffected Software
Jul 12, 2024
Data Sourced
via Launchpad·02:47 PM
Description
Dec 3, 2024
Data Sourced
via Ubuntu·03:10 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-35825?

CVE-2024-35825 is considered to have a moderate severity due to its potential impact on data integrity during USB communication.

2

How do I fix CVE-2024-35825?

To fix CVE-2024-35825, upgrade your Linux kernel to either version 5.10.223-1, 5.10.226-1, 6.1.123-1, 6.1.119-1, 6.12.10-1, or 6.12.11-1 as applicable.

3

What systems are affected by CVE-2024-35825?

CVE-2024-35825 affects specific versions of the Linux kernel used in various distributions such as Debian.

4

What does CVE-2024-35825 involve?

CVE-2024-35825 involves a vulnerability related to improper handling of zero block length packets in the USB gadget subsystem of the Linux kernel.

5

Are there any workarounds for CVE-2024-35825?

There are currently no recommended workarounds for CVE-2024-35825; the best approach is to apply the necessary kernel updates.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203