]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_core: Fix possible buffer overflow
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 28 Feb 2024 15:49:26 +0000 (10:49 -0500)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:38 +0000 (18:19 -0400)
commita41c8efe659caed0e21422876bbb6b73c15b5244
tree9536e0a9327c48e3d5bd95f4fcdbdaee0ec7463d
parentdd163fa34c483f1674aa2510accce11a224f649e
Bluetooth: hci_core: Fix possible buffer overflow

[ Upstream commit 81137162bfaa7278785b24c1fd2e9e74f082e8e4 ]

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: dcda165706b9 ("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>
net/bluetooth/hci_core.c