usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1650113888fe7b7e16604a5019c32dd3ddeb3af2 · < 09e4507ec8ef2d44da6ba4092b8ee2d81f216497| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
In Google internal bug 265639009 we've received an (as yet) unreproducible crash report from an aarch64 GKI 5.10.149-android13 running device.
AFAICT the source code is at: https://android.googlesource.com/kernel/common/+/refs/tags/ASB-2022-12-05_13-5.10
The call stack is: ncm_close() -> ncm_notify() -> ncm_do_notify() with the crash at: ncm_do_notify+0x98/0x270 Code: 79000d0b b9000a6c f940012a f9400269 (b9405d4b)
Which I believe disassembles to (I don't know ARM assembly, but it looks sane enough to me...):
// halfword (16-bit) store presumably to event->wLength (at offset 6 of struct usb_cdc_notification) 0B 0D 00 79 strh w11, [x8, #6]
// word (32-bit) store presumably to req->Length (at offset 8 of struct usb_request) 6C 0A 00 B9 str w12, [x19, #8]
From the CVE record · Linux
The Linux kernel USB NCM gadget code can dereference a NULL gadget pointer while calculating bitrate for a speed-change notification, potentially causing a kernel crash. The input does not establish how an attacker could trigger this or whether network access, authentication, or user interaction is required.
Engineers running Linux kernels with the USB NCM gadget code should check their builds; a crash was reported on an aarch64 GKI 5.10.149-android13 device, but the full affected version range is not specified.