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 C44E22DAFC1; Tue, 8 Jul 2025 16:26:30 +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=1751991990; cv=none; b=VRSoaLOggPqbA8PW/mYL3ST/aBNzLl7Vb9sW9dG1QAFMosV8/bIMVMUVk0yg0oFg0VqlUilDKwm1qAX2kSMmlaxrAkPgR7CAmVBeFKswSIYFUVqq96IOB5Hqq3xHn+2MdEJu9dPQ+KekeQiCTfzDhEBJ6Zk6oRIQPwotx/dEPCQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751991990; c=relaxed/simple; bh=woF+iXVk3c/pdkGO7/86vhcrQq+BZjyEfTwTR9lC/uQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sVZPx/zzCaVe1SlO/MLEckyXc6c1DpaeoNKYtjsbHqeDpMnFCiwUDse1WH9237Kg0+idrbxZj0oYghOGc5Fb8Nz2WmvjbrnC7CkJUMbcGz06ExSVJbCtuuhn7Qs7+xmR7osHI4te9whPx8+Z9Ag9+1yZ/r+dejXwwdewULe0f6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HvByf5A3; 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="HvByf5A3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 005A2C4CEED; Tue, 8 Jul 2025 16:26:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751991990; bh=woF+iXVk3c/pdkGO7/86vhcrQq+BZjyEfTwTR9lC/uQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HvByf5A3MCFro+7+6OpD/F93niOBYWMBa7Wla2xAOCc0xyqd8xtCx8SQnhkWkmXQm Vieg5Y296BsDtHhbigdVZ9aVplx2enkNN8oy6Sg5LOpwwhs+wTvK/soWietoouLmvk NBHh1cTvT2wPRLR85heRgRYH80IHiIM5SAI7ou9o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yang Li , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 25/81] Bluetooth: Prevent unintended pause by checking if advertising is active Date: Tue, 8 Jul 2025 18:23:17 +0200 Message-ID: <20250708162225.733340459@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250708162224.795155912@linuxfoundation.org> References: <20250708162224.795155912@linuxfoundation.org> User-Agent: quilt/0.68 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 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yang Li [ Upstream commit 1f029b4e30a602db33dedee5ac676e9236ad193c ] When PA Create Sync is enabled, advertising resumes unexpectedly. Therefore, it's necessary to check whether advertising is currently active before attempting to pause it. < HCI Command: LE Add Device To... (0x08|0x0011) plen 7 #1345 [hci0] 48.306205 Address type: Random (0x01) Address: 4F:84:84:5F:88:17 (Resolvable) Identity type: Random (0x01) Identity: FC:5B:8C:F7:5D:FB (Static) < HCI Command: LE Set Address Re.. (0x08|0x002d) plen 1 #1347 [hci0] 48.308023 Address resolution: Enabled (0x01) ... < HCI Command: LE Set Extended A.. (0x08|0x0039) plen 6 #1349 [hci0] 48.309650 Extended advertising: Enabled (0x01) Number of sets: 1 (0x01) Entry 0 Handle: 0x01 Duration: 0 ms (0x00) Max ext adv events: 0 ... < HCI Command: LE Periodic Adve.. (0x08|0x0044) plen 14 #1355 [hci0] 48.314575 Options: 0x0000 Use advertising SID, Advertiser Address Type and address Reporting initially enabled SID: 0x02 Adv address type: Random (0x01) Adv address: 4F:84:84:5F:88:17 (Resolvable) Identity type: Random (0x01) Identity: FC:5B:8C:F7:5D:FB (Static) Skip: 0x0000 Sync timeout: 20000 msec (0x07d0) Sync CTE type: 0x0000 Fixes: ad383c2c65a5 ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled") Signed-off-by: Yang Li Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/hci_sync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index acaa8d45feb8a..c1e018eaa6f4c 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -2474,6 +2474,10 @@ static int hci_pause_advertising_sync(struct hci_dev *hdev) int err; int old_state; + /* If controller is not advertising we are done. */ + if (!hci_dev_test_flag(hdev, HCI_LE_ADV)) + return 0; + /* If already been paused there is nothing to do. */ if (hdev->advertising_paused) return 0; -- 2.39.5