<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/net/bluetooth/mgmt.c, branch dev-4.4</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.4</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-4.4'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2016-04-12T16:08:54+00:00</updated>
<entry>
<title>Bluetooth: Fix potential buffer overflow with Add Advertising</title>
<updated>2016-04-12T16:08:54+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-03-11T07:56:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=f0de3cec40ee0f365751e11a477e47dd5568c34e'/>
<id>urn:sha1:f0de3cec40ee0f365751e11a477e47dd5568c34e</id>
<content type='text'>
commit 6a0e78072c2ae7b20b14e0249d8108441ea928d2 upstream.

The Add Advertising command handler does the appropriate checks for
the AD and Scan Response data, however fails to take into account the
general length of the mgmt command itself, which could lead to
potential buffer overflows. This patch adds the necessary check that
the mgmt command length is consistent with the given ad and scan_rsp
lengths.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Bluetooth: Take advantage of connection abort helpers</title>
<updated>2015-10-22T09:37:22+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-22T07:49:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=89e0ccc882c47a4553698a580bec70cd90bc6319'/>
<id>urn:sha1:89e0ccc882c47a4553698a580bec70cd90bc6319</id>
<content type='text'>
Convert the various places mapping connection state to
disconnect/cancel HCI command to use the new hci_abort_conn helper
API.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix crash in SMP when unpairing</title>
<updated>2015-10-22T07:02:03+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-22T06:38:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c81d555a264bde740adc314f3931046994534106'/>
<id>urn:sha1:c81d555a264bde740adc314f3931046994534106</id>
<content type='text'>
When unpairing the keys stored in hci_dev are removed. If SMP is
ongoing the SMP context will also have references to these keys, so
removing them from the hci_dev lists will make the pointers invalid.
This can result in the following type of crashes:

 BUG: unable to handle kernel paging request at 6b6b6b6b
 IP: [&lt;c11f26be&gt;] __list_del_entry+0x44/0x71
 *pde = 00000000
 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
 Modules linked in: hci_uart btqca btusb btintel btbcm btrtl hci_vhci rfcomm bluetooth_6lowpan bluetooth
 CPU: 0 PID: 723 Comm: kworker/u5:0 Not tainted 4.3.0-rc3+ #1379
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.8.1-20150318_183358- 04/01/2014
 Workqueue: hci0 hci_rx_work [bluetooth]
 task: f19da940 ti: f1a94000 task.ti: f1a94000
 EIP: 0060:[&lt;c11f26be&gt;] EFLAGS: 00010202 CPU: 0
 EIP is at __list_del_entry+0x44/0x71
 EAX: c0088d20 EBX: f30fcac0 ECX: 6b6b6b6b EDX: 6b6b6b6b
 ESI: f4b60000 EDI: c0088d20 EBP: f1a95d90 ESP: f1a95d8c
  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
 CR0: 8005003b CR2: 6b6b6b6b CR3: 319e5000 CR4: 00000690
 Stack:
  f30fcac0 f1a95db0 f82dc3e1 f1bfc000 00000000 c106524f f1bfc000 f30fd020
  f1a95dc0 f1a95dd0 f82dcbdb f1a95de0 f82dcbdb 00000067 f1bfc000 f30fd020
  f1a95de0 f1a95df0 f82d1126 00000067 f82d1126 00000006 f30fd020 f1bfc000
 Call Trace:
  [&lt;f82dc3e1&gt;] smp_chan_destroy+0x192/0x240 [bluetooth]
  [&lt;c106524f&gt;] ? trace_hardirqs_on_caller+0x14e/0x169
  [&lt;f82dcbdb&gt;] smp_teardown_cb+0x47/0x64 [bluetooth]
  [&lt;f82dcbdb&gt;] ? smp_teardown_cb+0x47/0x64 [bluetooth]
  [&lt;f82d1126&gt;] l2cap_chan_del+0x5d/0x14d [bluetooth]
  [&lt;f82d1126&gt;] ? l2cap_chan_del+0x5d/0x14d [bluetooth]
  [&lt;f82d40ef&gt;] l2cap_conn_del+0x109/0x17b [bluetooth]
  [&lt;f82d40ef&gt;] ? l2cap_conn_del+0x109/0x17b [bluetooth]
  [&lt;f82c0205&gt;] ? hci_event_packet+0x5b1/0x2092 [bluetooth]
  [&lt;f82d41aa&gt;] l2cap_disconn_cfm+0x49/0x50 [bluetooth]
  [&lt;f82d41aa&gt;] ? l2cap_disconn_cfm+0x49/0x50 [bluetooth]
  [&lt;f82c0228&gt;] hci_event_packet+0x5d4/0x2092 [bluetooth]
  [&lt;c1332c16&gt;] ? skb_release_data+0x6a/0x95
  [&lt;f82ce5d4&gt;] ? hci_send_to_monitor+0xe7/0xf4 [bluetooth]
  [&lt;c1409708&gt;] ? _raw_spin_unlock_irqrestore+0x44/0x57
  [&lt;f82b3bb0&gt;] hci_rx_work+0xf1/0x28b [bluetooth]
  [&lt;f82b3bb0&gt;] ? hci_rx_work+0xf1/0x28b [bluetooth]
  [&lt;c10635a0&gt;] ? __lock_is_held+0x2e/0x44
  [&lt;c104772e&gt;] process_one_work+0x232/0x432
  [&lt;c1071ddc&gt;] ? rcu_read_lock_sched_held+0x50/0x5a
  [&lt;c104772e&gt;] ? process_one_work+0x232/0x432
  [&lt;c1047d48&gt;] worker_thread+0x1b8/0x255
  [&lt;c1047b90&gt;] ? rescuer_thread+0x23c/0x23c
  [&lt;c104bb71&gt;] kthread+0x91/0x96
  [&lt;c14096a7&gt;] ? _raw_spin_unlock_irq+0x27/0x44
  [&lt;c1409d61&gt;] ret_from_kernel_thread+0x21/0x30
  [&lt;c104bae0&gt;] ? kthread_parkme+0x1e/0x1e

To solve the issue, introduce a new smp_cancel_pairing() API that can
be used to clean up the SMP state before touching the hci_dev lists.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Disable auto-connection parameters when unpairing</title>
<updated>2015-10-22T07:02:03+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-22T06:38:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=fc64361ac15318126c64193929616fc4832071a6'/>
<id>urn:sha1:fc64361ac15318126c64193929616fc4832071a6</id>
<content type='text'>
For connection parameters that are left around until a disconnection
we should at least clear any auto-connection properties. This way a
new Add Device call is required to re-set them after calling Unpair
Device.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Remove unnecessary indentation in unpair_device()</title>
<updated>2015-10-21T16:40:21+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-21T15:03:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=ec182f0397e7065dabf13a99fc745fcab0bdc641'/>
<id>urn:sha1:ec182f0397e7065dabf13a99fc745fcab0bdc641</id>
<content type='text'>
Instead of doing all of the LE-specific handling in an else-branch in
unpair_device() create a 'done' label for the BR/EDR branch to jump to
and then remove the else-branch completely.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Use hci_conn_hash_lookup_le() when possible</title>
<updated>2015-10-21T16:38:22+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-21T15:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=9d4c1cc15b14b4a96ddfcfac533a12f9f527c129'/>
<id>urn:sha1:9d4c1cc15b14b4a96ddfcfac533a12f9f527c129</id>
<content type='text'>
Use the new hci_conn_hash_lookup_le() API to look up LE connections.
This way we're guaranteed exact matches that also take into account
the address type.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add le_addr_type() helper function</title>
<updated>2015-10-21T16:35:00+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-21T15:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=85813a7ec774b982899c82f86c52cad47588f863'/>
<id>urn:sha1:85813a7ec774b982899c82f86c52cad47588f863</id>
<content type='text'>
The mgmt code needs to convert from mgmt/L2CAP address types to HCI in
many places. Having a dedicated helper function for this simplifies
code by shortening it and removing unnecessary 'addr_type' variables.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix removing connection parameters when unpairing</title>
<updated>2015-10-20T22:49:24+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-19T07:51:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a6ad2a6b9cc1d9d791aee5462cfb8528f366f1d4'/>
<id>urn:sha1:a6ad2a6b9cc1d9d791aee5462cfb8528f366f1d4</id>
<content type='text'>
The commit 89cbb0638e9b7 introduced support for deferred connection
parameter removal when unpairing by removing them only once an
existing connection gets disconnected. However, it failed to address
the scenario when we're *not* connected and do an unpair operation.

What makes things worse is that most user space BlueZ versions will
first issue a disconnect request and only then unpair, meaning the
buggy code will be triggered every time. This effectively causes the
kernel to resume scanning and reconnect to a device for which we've
removed all keys and GATT database information.

This patch fixes the issue by adding the missing call to the
hci_conn_params_del() function to a branch which handles the case of
no existing connection.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: stable@vger.kernel.org # 3.19+
</content>
</entry>
<entry>
<title>Bluetooth: Don't use remote address type to decide IRK persistency</title>
<updated>2015-10-20T22:49:21+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2015-10-12T11:36:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=cad20c278085d893ebd616cd20c0747a8e9d53c7'/>
<id>urn:sha1:cad20c278085d893ebd616cd20c0747a8e9d53c7</id>
<content type='text'>
There are LE devices on the market that start off by announcing their
public address and then once paired switch to using private address.
To be interoperable with such devices we should simply trust the fact
that we're receiving an IRK from them to indicate that they may use
private addresses in the future. Instead, simply tie the persistency
to the bonding/no-bonding information the same way as for LTKs and
CSRKs.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix initializing conn_params in scan phase</title>
<updated>2015-10-16T07:24:41+00:00</updated>
<author>
<name>Jakub Pawlowski</name>
<email>jpawlowski@google.com</email>
</author>
<published>2015-10-16T07:07:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=5157b8a503fa834e8569c7fed06981e3d3d53db0'/>
<id>urn:sha1:5157b8a503fa834e8569c7fed06981e3d3d53db0</id>
<content type='text'>
This patch makes sure that conn_params that were created just for
explicit_connect, will get properly deleted during cleanup.

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