Patch "Bluetooth: hci_sync: Check the correct flag before starting a scan" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Bluetooth: hci_sync: Check the correct flag before starting a scan

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bluetooth-hci_sync-check-the-correct-flag-before-sta.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e79410c1cfcfab1aa5dcdc5e466580c1b3c08692
Author: Jonas Dreßler <verdre@xxxxxxx>
Date:   Tue Jan 2 19:08:08 2024 +0100

    Bluetooth: hci_sync: Check the correct flag before starting a scan
    
    [ Upstream commit 6b3899be24b16ff8ee0cb25f0bd59b01b15ba1d1 ]
    
    There's a very confusing mistake in the code starting a HCI inquiry: We're
    calling hci_dev_test_flag() to test for HCI_INQUIRY, but hci_dev_test_flag()
    checks hdev->dev_flags instead of hdev->flags. HCI_INQUIRY is a bit that's
    set on hdev->flags, not on hdev->dev_flags though.
    
    HCI_INQUIRY equals the integer 7, and in hdev->dev_flags, 7 means
    HCI_BONDABLE, so we were actually checking for HCI_BONDABLE here.
    
    The mistake is only present in the synchronous code for starting an inquiry,
    not in the async one. Also devices are typically bondable while doing an
    inquiry, so that might be the reason why nobody noticed it so far.
    
    Fixes: abfeea476c68 ("Bluetooth: hci_sync: Convert MGMT_OP_START_DISCOVERY")
    Signed-off-by: Jonas Dreßler <verdre@xxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 5c4efa6246256..497b12e0374e0 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -5633,7 +5633,7 @@ static int hci_inquiry_sync(struct hci_dev *hdev, u8 length)
 
 	bt_dev_dbg(hdev, "");
 
-	if (hci_dev_test_flag(hdev, HCI_INQUIRY))
+	if (test_bit(HCI_INQUIRY, &hdev->flags))
 		return 0;
 
 	hci_dev_lock(hdev);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux