CVE-2024-36895·Kernel vulnerability
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.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.8.10
- Published
- 2024-05-30
Affected versions
From: 6.7
Until: 6.8.10
Fixed in: 6.8.10
How to fix this CVE
Update your Linux kernel to version 6.8.10 or later to fix a buffer size validation flaw in the USB UVC gadget driver that affects 32-bit platforms. This vulnerability impacts configfs attribute parsing and can cause buffer overruns when processing certain UVC parameters. Systems running kernels 6.7 through 6.8.9 should prioritize this update, especially if they expose USB gadget functionality or use UVC device emulation.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check your kernel version with `uname -r` and compare against the affected range (6.7–6.8.9)
- Step 2: Verify if USB gadget modules are loaded by running `lsmod | grep uvc` or `lsmod | grep gadget`
- Step 3: Check syslog for buffer overflow warnings or kernel panics related to UVC configfs parsing: `sudo grep -i 'uvc\|gadget\|buffer' /var/log/syslog /var/log/kern.log`
- Step 4: After updating, confirm the new kernel is active with `uname -r` and verify it matches 6.8.10 or later
FAQ
What is CVE-2024-36895?
This vulnerability is a buffer size miscalculation in the Linux kernel's USB UVC gadget driver that occurs when parsing configfs attribute lists. The bug causes the kernel to use an incorrect maximum buffer size on 32-bit systems, allowing multi-digit numeric values like frame intervals to trigger buffer overruns.
Is CVE-2024-36895 being actively exploited?
No, CVE-2024-36895 is not listed in the CISA Known Exploited Vulnerabilities catalog and no public exploits are currently available.
What versions of Kernel are affected by CVE-2024-36895?
Linux kernel versions 6.7 through 6.8.9 are vulnerable. The fix is included in kernel 6.8.10 and later.
How do I check if my server is vulnerable to CVE-2024-36895?
Run `uname -r` to display your kernel version. If it shows a version between 6.7 and 6.8.9, your system is vulnerable. You can also check `cat /proc/version` for additional kernel build details.
Does Defensia detect CVE-2024-36895?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2024-36895 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/650ae71c80749fc7cb8858c8049f532eaec64410
- https://git.kernel.org/stable/c/7a54e5052bde582fd0e7677334fe7a5be92e242c
- https://git.kernel.org/stable/c/a422089ce42ced73713e5032aad29a9a7cbe9528
- https://git.kernel.org/stable/c/650ae71c80749fc7cb8858c8049f532eaec64410
- https://git.kernel.org/stable/c/7a54e5052bde582fd0e7677334fe7a5be92e242c
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-36895. Free for 1 server.
Get started free