CVE-2026-74679: usb: gadget: f_ncm: Use unsigned int for ndp_index
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: fncm: Use unsigned int for ndpindex
The variable ndpindex is declared as a signed integer, but it stores the return value of getncm(), which is unsigned.
A malicious host can supply a large offset that overflows the signed ndpindex, making it negative. Because ndpindex is compared against unsigned bounds, this negative value bypasses sanity checks and leads to an out-of-bounds read when calculating the address of the NDP block (ntbptr + ndpindex).
Fix this by changing ndpindex to unsigned int to ensure consistent unsigned comparisons throughout the function.
Affected Software
Event History
Frequently Asked Questions
Who can trigger this vulnerability?
A malicious USB host can trigger it by supplying a large offset while the affected system is operating as a USB gadget using the f_ncm function.
What condition makes exploitation possible?
The host-controlled offset must overflow the signed ndp_index value so it becomes negative. Mixed signed-versus-unsigned bounds comparisons then allow the negative value to bypass sanity checks and cause an out-of-bounds read.
How can I tell whether a system contains the fix?
Check whether the kernel's f_ncm code declares ndp_index as unsigned int rather than a signed integer. The referenced stable kernel commits contain the correction.