From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDA9215EA0 for ; Mon, 23 Oct 2023 11:41:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="X1/Gpqsw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 496F5C433C8; Mon, 23 Oct 2023 11:41:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698061310; bh=V/GN6NzSGlIiNKl+7OGzxUqN3Rye//QAdfVxfoLdykY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X1/Gpqsw5xoKiGacX0IqPz6ipkNHueaaF5DYJ7GnNdMUPoVelN9FCCXujKwnSQyXC uwZ3xNi00hqzVjGfhcW1AubYXC6/Kk8cIphhiJnxHNvt+8Hu2RUWmKLvcQM8hXstsZ LRjqXe3yFzdSMF8d52ghn2fE1vW5QTDCSfSSvenY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+c90849c50ed209d77689@syzkaller.appspotmail.com, Edward AD , Luiz Augusto von Dentz Subject: [PATCH 5.15 135/137] Bluetooth: hci_sock: fix slab oob read in create_monitor_event Date: Mon, 23 Oct 2023 12:58:12 +0200 Message-ID: <20231023104825.230842827@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231023104820.849461819@linuxfoundation.org> References: <20231023104820.849461819@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Edward AD commit 18f547f3fc074500ab5d419cf482240324e73a7e upstream. When accessing hdev->name, the actual string length should prevail Reported-by: syzbot+c90849c50ed209d77689@syzkaller.appspotmail.com Fixes: dcda165706b9 ("Bluetooth: hci_core: Fix build warnings") Signed-off-by: Edward AD Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/hci_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -438,7 +438,7 @@ static struct sk_buff *create_monitor_ev 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;