usb: gadget: f_ncm: Use unsigned int for ndp_index
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 370af734dfaf8336b496b386e194648e097e248a · < d328fdc607fa1bb668ad512e1c918a120f78f337| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_ncm: Use unsigned int for ndp_index
The variable ndp_index is declared as a signed integer, but it stores the return value of get_ncm(), which is unsigned.
A malicious host can supply a large offset that overflows the signed ndp_index, making it negative. Because ndp_index 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 (ntb_ptr + ndp_index).
Fix this by changing ndp_index to unsigned int to ensure consistent unsigned comparisons throughout the function.
From the CVE record · Linux
The Linux kernel USB NCM gadget function uses a signed index for an unsigned offset. A malicious USB host can supply a large offset that bypasses bounds checks and causes an out-of-bounds read. The report does not specify authentication requirements.
Engineers running Linux kernels with the USB NCM gadget function should check their kernel's status; affected versions are not specified.