CVE-2024-36895
usb: gadget: uvc: use correct buffer size when parsing configfs lists
Check your servers for CVE-2024-36895
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-36895 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: uvc: use correct buffer size when parsing configfs lists
This commit fixes uvc gadget support on 32-bit platforms.
Commit 0df28607c5cb ("usb: gadget: uvc: Generalise helper functions for reuse") introduced a helper function __uvcg_iter_item_entries() to aid with parsing lists of items on configfs attributes stores. This function is a generalization of another very similar function, which used a stack-allocated temporary buffer of fixed size for each item in the list and used the sizeof() operator to check for potential buffer overruns. The new function was changed to allocate the now variably sized temp buffer on heap, but wasn't properly updated to also check for max buffer size using the computed size instead of sizeof() operator.
As a result, the maximum item size was 7 (plus null terminator) on 64-bit platforms, and 3 on 32-bit ones. While 7 is accidentally just barely enough, 3 is definitely too small for some of UVC configfs attributes. For example, dwFrameInteval, specified in 100ns units, usually has 6-digit item values, e.g. 166666 for 60fps.
Exploitation
EPSS 0.23%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 15.3% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 6 Jun 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 0df28607c5cb4fe60bba591e9858a8f7ba39aa4a, before 7a54e5052bde582fd0e7677334fe7a5be92e242c affected from 0df28607c5cb4fe60bba591e9858a8f7ba39aa4a, before a422089ce42ced73713e5032aad29a9a7cbe9528 affected from 0df28607c5cb4fe60bba591e9858a8f7ba39aa4a, before 650ae71c80749fc7cb8858c8049f532eaec64410
Other versions: unaffected
|
| Linux |
affected 6.3 unaffected before 6.3 unaffected from 6.6.31 up to and including 6.6.* unaffected from 6.8.10 up to and including 6.8.* unaffected 6.9 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-36895 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-36895
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-36895
trivy image --scanners vuln IMAGE | grep CVE-2024-36895
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/7a54e5052bde582fd0e7677334fe7a5be92e242c git.kernel.org
- https://git.kernel.org/stable/c/a422089ce42ced73713e5032aad29a9a7cbe9528 git.kernel.org
- https://git.kernel.org/stable/c/650ae71c80749fc7cb8858c8049f532eaec64410 git.kernel.org
Source: the record CVE-2024-36895 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse