Commit 03f1700b authored by Dmitry Antipov's avatar Dmitry Antipov Committed by Luiz Augusto von Dentz
Browse files

Bluetooth: MGMT: reject malformed HCI_CMD_SYNC commands



In 'mgmt_hci_cmd_sync()', check whether the size of parameters passed
in 'struct mgmt_cp_hci_cmd_sync' matches the total size of the data
(i.e. 'sizeof(struct mgmt_cp_hci_cmd_sync)' plus trailing bytes).
Otherwise, large invalid 'params_len' will cause 'hci_cmd_sync_alloc()'
to do 'skb_put_data()' from an area beyond the one actually passed to
'mgmt_hci_cmd_sync()'.

Reported-by: default avatar <syzbot+5fe2d5bfbfbec0b675a0@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=5fe2d5bfbfbec0b675a0


Fixes: 827af478 ("Bluetooth: MGMT: Add initial implementation of MGMT_OP_HCI_CMD_SYNC")
Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent d3faab9b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment