mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
Bluetooth: hci_core: Fix possible buffer overflow
[ Upstream commit81137162bf
] struct hci_dev_info has a fixed size name[8] field so in the event that hdev->name is bigger than that strcpy would attempt to write past its size, so this fixes this problem by switching to use strscpy. Fixes:dcda165706
("Bluetooth: hci_core: Fix build warnings") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0c657e641d
commit
2edce8e9a9
@ -908,7 +908,7 @@ int hci_get_dev_info(void __user *arg)
|
||||
else
|
||||
flags = hdev->flags;
|
||||
|
||||
strcpy(di.name, hdev->name);
|
||||
strscpy(di.name, hdev->name, sizeof(di.name));
|
||||
di.bdaddr = hdev->bdaddr;
|
||||
di.type = (hdev->bus & 0x0f) | ((hdev->dev_type & 0x03) << 4);
|
||||
di.flags = flags;
|
||||
|
Loading…
Reference in New Issue
Block a user