]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: hci_core: Fix using ll_privacy_capable for current settings
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 4 Aug 2025 18:05:03 +0000 (14:05 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:45 +0000 (16:34 +0200)
[ Upstream commit 3dcf7175f2c04bd3a7d50db3fa42a0bd933b6e23 ]

ll_privacy_capable only indicates that the controller supports the
feature but it doesnt' check that LE is enabled so it end up being
marked as active in the current settings when it shouldn't.

Fixes: ad383c2c65a5 ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/bluetooth/hci_core.h
net/bluetooth/mgmt.c

index e77cb840deee20642c746f4a150ddad6d0a5eb1e..2fcd62fdbc876a967575b61224a5d6b866a1c7f7 100644 (file)
@@ -1951,6 +1951,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
                         ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
 
 #define ll_privacy_capable(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY)
+#define ll_privacy_enabled(dev) (le_enabled(dev) && ll_privacy_capable(dev))
 
 #define privacy_mode_capable(dev) (ll_privacy_capable(dev) && \
                                   ((dev)->commands[39] & 0x04))
index 7a75309e6fd4c17c2fb6f1438c612437d72ec434..d4405d3d9bc1f17425972160d4ac13d5972d0e99 100644 (file)
@@ -934,7 +934,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
        if (sync_recv_enabled(hdev))
                settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
 
-       if (ll_privacy_capable(hdev))
+       if (ll_privacy_enabled(hdev))
                settings |= MGMT_SETTING_LL_PRIVACY;
 
        return settings;