Skip to content

Commit fadf982

Browse files
pvKyleGospo
authored andcommitted
Bluetooth: btmtk: accept too short WMT FUNC_CTRL events
MT7925 (USB ID 0e8d:e025) on fw version 20260106153314 sends WMT FUNC_CTRL events that are missing the status field. Prior to commit 006b9943b982 ("Bluetooth: btmtk: validate WMT event SKB length before struct access") the status was read from out-of-bounds of SKB data, which usually would result to success with BTMTK_WMT_ON_UNDONE, although I don't know the intent here. The bounds check added in that commit returns with error instead, producing "Bluetooth: hci0: Failed to send wmt func ctrl (-22)" and makes the device unusable. Fix the regression by interpreting too short packet as status BTMTK_WMT_ON_UNDONE, which makes the device work normally again. Fixes: 634a440 ("Bluetooth: btmtk: validate WMT event SKB length before struct access") Signed-off-by: Pauli Virtanen <pav@iki.fi> Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com> # MT7922 (0489:e0e2) Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent c8b18bb commit fadf982

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/bluetooth/btmtk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,8 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
678678
case BTMTK_WMT_FUNC_CTRL:
679679
if (!skb_pull_data(data->evt_skb,
680680
sizeof(wmt_evt_funcc->status))) {
681-
err = -EINVAL;
682-
goto err_free_skb;
681+
status = BTMTK_WMT_ON_UNDONE;
682+
break;
683683
}
684684

685685
wmt_evt_funcc = (struct btmtk_hci_wmt_evt_funcc *)wmt_evt;

0 commit comments

Comments
 (0)