Skip to content

Commit 18f547f

Browse files
Edward ADVudentz
authored andcommitted
Bluetooth: hci_sock: fix slab oob read in create_monitor_event
When accessing hdev->name, the actual string length should prevail Reported-by: [email protected] Fixes: dcda165 ("Bluetooth: hci_core: Fix build warnings") Signed-off-by: Edward AD <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 9ee2528 commit 18f547f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bluetooth/hci_sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event)
488488
ni->type = hdev->dev_type;
489489
ni->bus = hdev->bus;
490490
bacpy(&ni->bdaddr, &hdev->bdaddr);
491-
memcpy(ni->name, hdev->name, 8);
491+
memcpy(ni->name, hdev->name, strlen(hdev->name));
492492

493493
opcode = cpu_to_le16(HCI_MON_NEW_INDEX);
494494
break;

0 commit comments

Comments
 (0)