Bluetooth: MGMT: reject HCI_CMD_SYNC params_len above 255
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: MGMT: reject HCI_CMD_SYNC params_len above 255
mgmt_hci_cmd_sync() checks that the message length agrees with params_len but puts no upper bound on it. params_len is __le16 while the parameter length in the HCI command header is a u8:
struct hci_command_hdr { __le16 opcode; __u8 plen; } __packed;
hci_cmd_sync_alloc() assigns one to the other:
hdr->plen = plen;
if (plen) skb_put_data(skb, param, plen);
so a params_len of 256 leaves plen at 0 while all 256 bytes are still appended. The frame handed to the driver then declares no parameters and carries 256 of them. On a length framed transport such as H:4 the controller takes the trailing bytes as the start of the next packet.
From the CVE record · Linux
The Linux kernel’s Bluetooth MGMT interface accepts HCI_CMD_SYNC parameter lengths that exceed the one-byte length field in the HCI command header. An attacker able to send commands through a local MGMT socket can cause trailing parameter bytes to be interpreted as the start of another packet on length-framed transports such as H:4. The input does not specify authentication requirements or user interaction.
Engineers running Linux kernels with the affected Bluetooth MGMT code should check their versions against the vendor advisory; affected versions are not specified.