Bluetooth: MSFT: validate evt_prefix_len against the response length
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 145373cb1b1fcdba2059e945d0aa2613af2e84d1 · < 7c2658023d839b651368a5b8b781bf9a817647cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MSFT: validate evt_prefix_len against the response length
read_supported_features() only checks that the response covers the fixed part of struct msft_rp_read_supported_features, which is 11 bytes:
if (skb->len < sizeof(*rp)) { bt_dev_err(hdev, "MSFT supported features length mismatch"); goto failed; }
evt_prefix[] is a flexible array member and rp->evt_prefix_len is an unvalidated u8 taken straight out of that response, so
msft->evt_prefix = kmemdup(rp->evt_prefix, rp->evt_prefix_len, GFP_KERNEL);
copies up to 255 bytes from a reply that may have carried none of them. What is copied is data the controller never sent, and it is then used to match incoming vendor events in msft_vendor_evt().
This is not an out-of-bounds access. An skb data allocation always has at least SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) bytes past the payload, which is more than the 255 byte maximum, so the read stays inside the allocation and KASAN does not report it. It is still a read of bytes the host was never given, with the length fully controlled by the controller.
From the CVE record · Linux
The Linux kernel Bluetooth MSFT feature handler does not check whether a controller response contains the event prefix length it declares. A controller that supplies a short response can cause the kernel to copy bytes beyond the response payload, though still within the allocated buffer, and use them to match vendor events. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with Bluetooth MSFT support should check their vendor advisory; affected versions are not specified.