[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 Oct 2023 13:36:57 +0800
From: Edward AD <twuufnxlz@...il.com>
To: syzbot+c90849c50ed209d77689@...kaller.appspotmail.com
Cc: davem@...emloft.net,
edumazet@...gle.com,
johan.hedberg@...il.com,
kuba@...nel.org,
linux-bluetooth@...r.kernel.org,
linux-kernel@...r.kernel.org,
luiz.dentz@...il.com,
luiz.von.dentz@...el.com,
marcel@...tmann.org,
netdev@...r.kernel.org,
pabeni@...hat.com,
syzkaller-bugs@...glegroups.com
Subject: [PATCH] Bluetooth: hci_sock: fix slab oob read in create_monitor_event
When accessing hdev->name, the actual string length should prevail
Reported-by: syzbot+c90849c50ed209d77689@...kaller.appspotmail.com
Fixes: dcda165706b9 ("Bluetooth: hci_core: Fix build warnings")
Signed-off-by: Edward AD <twuufnxlz@...il.com>
---
net/bluetooth/hci_sock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 5e4f718073b7..72abe54c45dd 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -488,7 +488,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event)
ni->type = hdev->dev_type;
ni->bus = hdev->bus;
bacpy(&ni->bdaddr, &hdev->bdaddr);
- memcpy(ni->name, hdev->name, 8);
+ memcpy(ni->name, hdev->name, strlen(hdev->name));
opcode = cpu_to_le16(HCI_MON_NEW_INDEX);
break;
--
2.25.1
Powered by blists - more mailing lists