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 C9989626B2; Mon, 4 Mar 2024 21:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709588075; cv=none; b=HNoNy2SiyLQqf987luea4o1Mq82bVuAaqWK3qFnGp2o3CL7nKtBKQgtPocE9n2SeVIBYy6ZKut4im7wVPbdJYho1WP9M/jllI52aU2UV+ZJM7qNARF86As5/yeJ3EzN3VwbPXBUGjeelaVCqe+jD7mBE/1FK+8oeIM6e3gYdxn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709588075; c=relaxed/simple; bh=wkyCYVKBiigmHKo0WYJ2B4AIh9bHQo4S6tqT/EFiE8c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z096SC/6xH0/TSzWEsWTWyp+CLBp+6g48vlcUPFj5pqiDGGD+RN2ua28sIvhTVm6eWmh4OdR/EzSC5mWSyfGygq7xltleTzjSYGfqjLeawrvc6RQHXhu6lhjX0SugKgOF/BDWIxmZ02OXR+7xCqPCmpGWG6HBc9vpb5A7RBQaC4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fycbc7yz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fycbc7yz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55A76C433F1; Mon, 4 Mar 2024 21:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709588075; bh=wkyCYVKBiigmHKo0WYJ2B4AIh9bHQo4S6tqT/EFiE8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fycbc7yzCo0hpA6YBJC+ZCoXrvf5qkbcpG/IYLe3bkceSNtI642gw3/L+m1+1poB+ OuX0e6Ct5VDzlQLCj53LfxDKri4pXBEtZrIyOBtxoIayWOlRZGrHrfrPY5BUfXcSVJ UFfWdfn6RKhDRN4srK4tHNRlMJ7WqG1BEiQqjVr4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zijun Hu , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 5.10 12/42] Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR Date: Mon, 4 Mar 2024 21:23:39 +0000 Message-ID: <20240304211538.054814670@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240304211537.631764077@linuxfoundation.org> References: <20240304211537.631764077@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zijun Hu [ Upstream commit 61a5ab72edea7ebc3ad2c6beea29d966f528ebfb ] hci_store_wake_reason() wrongly parses event HCI_Connection_Request as HCI_Connection_Complete and HCI_Connection_Complete as HCI_Connection_Request, so causes recording wakeup BD_ADDR error and potential stability issue, fix it by using the correct field. Fixes: 2f20216c1d6f ("Bluetooth: Emit controller suspend and resume events") Signed-off-by: Zijun Hu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/hci_event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 4027c79786fd3..40e9f1babe9e9 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -6139,10 +6139,10 @@ static void hci_store_wake_reason(struct hci_dev *hdev, u8 event, * keep track of the bdaddr of the connection event that woke us up. */ if (event == HCI_EV_CONN_REQUEST) { - bacpy(&hdev->wake_addr, &conn_complete->bdaddr); + bacpy(&hdev->wake_addr, &conn_request->bdaddr); hdev->wake_addr_type = BDADDR_BREDR; } else if (event == HCI_EV_CONN_COMPLETE) { - bacpy(&hdev->wake_addr, &conn_request->bdaddr); + bacpy(&hdev->wake_addr, &conn_complete->bdaddr); hdev->wake_addr_type = BDADDR_BREDR; } else if (event == HCI_EV_LE_META) { struct hci_ev_le_meta *le_ev = (void *)skb->data; -- 2.43.0