]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Bluetooth: MGMT: reject malformed HCI_CMD_SYNC commands
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 22 May 2025 18:16:02 +0000 (21:16 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 30 May 2025 17:29:30 +0000 (13:29 -0400)
commit03f1700b9b4d4f2fed3165370f3c23db76553178
treefa955cf2d48a39c9e0596e3367c1810f565b6e3b
parentd3faab9b5a6a0477d69c38bd11c43aa5e936f929
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: syzbot+5fe2d5bfbfbec0b675a0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=5fe2d5bfbfbec0b675a0
Fixes: 827af4787e74 ("Bluetooth: MGMT: Add initial implementation of MGMT_OP_HCI_CMD_SYNC")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c