lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 29 Oct 2021 10:33:19 +0200
From:   Marcel Holtmann <marcel@...tmann.org>
To:     Luiz Augusto von Dentz <luiz.dentz@...il.com>
Cc:     Archie Pusaka <apusaka@...gle.com>,
        linux-bluetooth <linux-bluetooth@...r.kernel.org>,
        CrosBT Upstreaming <chromeos-bluetooth-upstreaming@...omium.org>,
        Archie Pusaka <apusaka@...omium.org>,
        Sonny Sasaka <sonnysasaka@...omium.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>
Subject: Re: [PATCH] Bluetooth: Fix removing adv when processing cmd complete

Hi Luiz,

>> If we remove one instance of adv using Set Extended Adv Enable, there
>> is a possibility of issue occurs when processing the Command Complete
>> event. Especially, the adv_info might not be found since we already
>> remove it in hci_req_clear_adv_instance() -> hci_remove_adv_instance().
>> If that's the case, we will mistakenly proceed to remove all adv
>> instances instead of just one single instance.
>> 
>> This patch fixes the issue by checking the content of the HCI command
>> instead of checking whether the adv_info is found.
>> 
>> Signed-off-by: Archie Pusaka <apusaka@...omium.org>
>> Reviewed-by: Sonny Sasaka <sonnysasaka@...omium.org>
>> 
>> ---
>> 
>> net/bluetooth/hci_event.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>> 
>> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
>> index 3cba2bbefcd6..894670419a27 100644
>> --- a/net/bluetooth/hci_event.c
>> +++ b/net/bluetooth/hci_event.c
>> @@ -1326,8 +1326,10 @@ static void hci_cc_le_set_ext_adv_enable(struct hci_dev *hdev,
>>                                           &conn->le_conn_timeout,
>>                                           conn->conn_timeout);
>>        } else {
>> -               if (adv) {
>> -                       adv->enabled = false;
>> +               if (cp->num_of_sets) {
>> +                       if (adv)
>> +                               adv->enabled = false;
>> +
>>                        /* If just one instance was disabled check if there are
>>                         * any other instance enabled before clearing HCI_LE_ADV
>>                         */

I haven’t applied this yet since I wanted to make sure it doesn’t interfere with our set of 23 patches. Do you need to rebase?

Regards

Marcel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ