<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/bluetooth/hci_request.c, branch v4.9.331</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-05-22T08:40:20+00:00</updated>
<entry>
<title>bluetooth: eliminate the potential race condition when removing the HCI controller</title>
<updated>2021-05-22T08:40:20+00:00</updated>
<author>
<name>Lin Ma</name>
<email>linma@zju.edu.cn</email>
</author>
<published>2021-04-12T11:17:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34f1f8aecf16798c91154e0f6d56b4f804a39bd1'/>
<id>urn:sha1:34f1f8aecf16798c91154e0f6d56b4f804a39bd1</id>
<content type='text'>
commit e2cb6b891ad2b8caa9131e3be70f45243df82a80 upstream.

There is a possible race condition vulnerability between issuing a HCI
command and removing the cont.  Specifically, functions hci_req_sync()
and hci_dev_do_close() can race each other like below:

thread-A in hci_req_sync()      |   thread-B in hci_dev_do_close()
                                |   hci_req_sync_lock(hdev);
test_bit(HCI_UP, &amp;hdev-&gt;flags); |
...                             |   test_and_clear_bit(HCI_UP, &amp;hdev-&gt;flags)
hci_req_sync_lock(hdev);        |
                                |
In this commit we alter the sequence in function hci_req_sync(). Hence,
the thread-A cannot issue th.

Signed-off-by: Lin Ma &lt;linma@zju.edu.cn&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Fixes: 7c6a329e4447 ("[Bluetooth] Fix regression from using default link policy")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix advertising duplicated flags</title>
<updated>2020-01-04T12:39:31+00:00</updated>
<author>
<name>Luiz Augusto von Dentz</name>
<email>luiz.von.dentz@intel.com</email>
</author>
<published>2019-11-03T21:58:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=587af61769d35ca651c9204e717396bdac25459f'/>
<id>urn:sha1:587af61769d35ca651c9204e717396bdac25459f</id>
<content type='text'>
[ Upstream commit 6012b9346d8959194c239fd60a62dfec98d43048 ]

Instances may have flags set as part of its data in which case the code
should not attempt to add it again otherwise it can cause duplication:

&lt; HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 35
        Handle: 0x00
        Operation: Complete extended advertising data (0x03)
        Fragment preference: Minimize fragmentation (0x01)
        Data length: 0x06
        Flags: 0x04
          BR/EDR Not Supported
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix append max 11 bytes of name to scan rsp data</title>
<updated>2016-10-19T16:42:37+00:00</updated>
<author>
<name>Michał Narajowski</name>
<email>michal.narajowski@codecoup.pl</email>
</author>
<published>2016-10-19T08:20:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f61851f64b171a684f5a1fa78325756dbbaadadc'/>
<id>urn:sha1:f61851f64b171a684f5a1fa78325756dbbaadadc</id>
<content type='text'>
Append maximum of 10 + 1 bytes of name to scan response data.
Complete name is appended only if exists and is &lt;= 10 characters.
Else append short name if exists or shorten complete name if not.
This makes sure name is consistent across multiple advertising
instances.

Signed-off-by: Michał Narajowski &lt;michal.narajowski@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Refactor append name and appearance</title>
<updated>2016-10-06T09:52:29+00:00</updated>
<author>
<name>Michał Narajowski</name>
<email>michal.narajowski@codecoup.pl</email>
</author>
<published>2016-10-05T10:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1b422066658b7cc985fa020066b72d28159d858f'/>
<id>urn:sha1:1b422066658b7cc985fa020066b72d28159d858f</id>
<content type='text'>
Use eir_append_data to remove code duplication.

Signed-off-by: Michał Narajowski &lt;michal.narajowski@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add appearance to default scan rsp data</title>
<updated>2016-10-06T09:52:29+00:00</updated>
<author>
<name>Michał Narajowski</name>
<email>michal.narajowski@codecoup.pl</email>
</author>
<published>2016-10-05T10:28:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7ddb30c7471ed69b75ae4c2601d45cbda5d390ff'/>
<id>urn:sha1:7ddb30c7471ed69b75ae4c2601d45cbda5d390ff</id>
<content type='text'>
Add appearance value to beginning of scan rsp data for
default advertising instance if the value is not 0.

Signed-off-by: Michał Narajowski &lt;michal.narajowski@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix local name in scan rsp</title>
<updated>2016-10-06T09:52:29+00:00</updated>
<author>
<name>Michał Narajowski</name>
<email>michal.narajowski@codecoup.pl</email>
</author>
<published>2016-10-05T10:28:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cecbf3e932c1fa6df45fd6cc4fc8081a4cb45bcd'/>
<id>urn:sha1:cecbf3e932c1fa6df45fd6cc4fc8081a4cb45bcd</id>
<content type='text'>
Use complete name if it fits. If not and there is short name
check if it fits. If not then use shortened name as prefix
of complete name.

Signed-off-by: Michał Narajowski &lt;michal.narajowski@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add support for appearance in scan rsp</title>
<updated>2016-09-19T18:19:34+00:00</updated>
<author>
<name>Michał Narajowski</name>
<email>michal.narajowski@codecoup.pl</email>
</author>
<published>2016-09-18T10:50:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4960ecf2b09210930964ef2c05ce2590802ccf4'/>
<id>urn:sha1:c4960ecf2b09210930964ef2c05ce2590802ccf4</id>
<content type='text'>
This patch enables prepending appearance value to scan response data.
It also adds support for setting appearance value through mgmt command.
If currently advertised instance has apperance flag set it is expired
immediately.

Signed-off-by: Michał Narajowski &lt;michal.narajowski@codecoup.pl&gt;
Signed-off-by: Szymon Janc &lt;szymon.janc@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add support for local name in scan rsp</title>
<updated>2016-09-19T18:19:34+00:00</updated>
<author>
<name>Michał Narajowski</name>
<email>michal.narajowski@codecoup.pl</email>
</author>
<published>2016-09-18T10:50:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7c295c4801b2de24fc25687eb0cb73cf0c99d114'/>
<id>urn:sha1:7c295c4801b2de24fc25687eb0cb73cf0c99d114</id>
<content type='text'>
This patch enables appending local name to scan response data. If
currently advertised instance has name flag set it is expired
immediately.

Signed-off-by: Michał Narajowski &lt;michal.narajowski@codecoup.pl&gt;
Signed-off-by: Szymon Janc &lt;szymon.janc@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix reason code used for rejecting SCO connections</title>
<updated>2016-09-19T18:19:34+00:00</updated>
<author>
<name>Frédéric Dalleau</name>
<email>frederic.dalleau@collabora.co.uk</email>
</author>
<published>2016-09-08T10:00:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3c0975a7a1087add3bf873601f0270aa695d7616'/>
<id>urn:sha1:3c0975a7a1087add3bf873601f0270aa695d7616</id>
<content type='text'>
A comment in the code states that SCO connection should be rejected
with the proper error value between 0xd-0xf. The code uses
HCI_ERROR_REMOTE_LOW_RESOURCES which is 0x14.

This led to following error:
&lt; HCI Command: Reject Synchronous Co.. (0x01|0x002a) plen 7
        Address: 34:51:C9:EF:02:CA (Apple, Inc.)
        Reason: Remote Device Terminated due to Low Resources (0x14)
&gt; HCI Event: Command Status (0x0f) plen 4
      Reject Synchronous Connection Request (0x01|0x002a) ncmd 1
        Status: Invalid HCI Command Parameters (0x12)

Instead make use of HCI_ERROR_REJ_LIMITED_RESOURCES which is 0xd.

Signed-off-by: Frédéric Dalleau &lt;frederic.dalleau@collabora.co.uk&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: mgmt: Fix sending redundant event for Advertising Instance</title>
<updated>2016-09-19T18:19:34+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-08-28T17:53:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=37d3a1fab50fa07ac706787646e61c60e7c520e0'/>
<id>urn:sha1:37d3a1fab50fa07ac706787646e61c60e7c520e0</id>
<content type='text'>
When an Advertising Instance is removed, the Advertising Removed event
shouldn't be sent to the same socket that issued the Remove
Advertising command (it gets a command complete event instead). The
mgmt_advertising_removed() function already has a parameter for
skipping a specific socket, but there was no code to propagate the
right value to this parameter. This patch fixes the issue by making
sure the intermediate hci_req_clear_adv_instance() function gets the
socket pointer.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
