<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/bluetooth, branch v4.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-02-20T07:52:28Z</updated>
<entry>
<title>Bluetooth: hci_core: Avoid mixing up req_complete and req_complete_skb</title>
<updated>2016-02-20T07:52:28Z</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2016-02-19T22:25:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3bd7594e69bd97c962faa6a5ae15dd8c6c082636'/>
<id>urn:sha1:3bd7594e69bd97c962faa6a5ae15dd8c6c082636</id>
<content type='text'>
In commit 44d271377479 ("Bluetooth: Compress the size of struct
hci_ctrl") we squashed down the size of the structure by using a union
with the assumption that all users would use the flag to determine
whether we had a req_complete or a req_complete_skb.

Unfortunately we had a case in hci_req_cmd_complete() where we weren't
looking at the flag.  This can result in a situation where we might be
storing a hci_req_complete_skb_t in a hci_req_complete_t variable, or
vice versa.

During some testing I found at least one case where the function
hci_req_sync_complete() was called improperly because the kernel thought
that it didn't require an SKB.  Looking through the stack in kgdb I
found that it was called by hci_event_packet() and that
hci_event_packet() had both of its locals "req_complete" and
"req_complete_skb" pointing to the same place: both to
hci_req_sync_complete().

Let's make sure we always check the flag.

For more details on debugging done, see &lt;http://crbug.com/588288&gt;.

Fixes: 44d271377479 ("Bluetooth: Compress the size of struct hci_ctrl")
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Acked-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 incorrect removing of IRKs</title>
<updated>2016-01-29T10:47:24Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-01-26T19:31:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cff10ce7b4f02718ffd25e3914e60559f5ef6ca0'/>
<id>urn:sha1:cff10ce7b4f02718ffd25e3914e60559f5ef6ca0</id>
<content type='text'>
The commit cad20c278085d893ebd616cd20c0747a8e9d53c7 was supposed to
fix handling of devices first using public addresses and then
switching to RPAs after pairing. Unfortunately it missed a couple of
key places in the code.

1. When evaluating which devices should be removed from the existing
white list we also need to consider whether we have an IRK for them or
not, i.e. a call to hci_find_irk_by_addr() is needed.

2. In smp_notify_keys() we should not be requiring the knowledge of
the RPA, but should simply keep the IRK around if the other conditions
require it.

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 # 4.4+
</content>
</entry>
<entry>
<title>Bluetooth: L2CAP: Fix setting chan src info before adding PSM/CID</title>
<updated>2016-01-29T10:47:24Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-01-26T22:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a2342c5fe5f2810b8ef6a0826bd584aa709dd2c6'/>
<id>urn:sha1:a2342c5fe5f2810b8ef6a0826bd584aa709dd2c6</id>
<content type='text'>
At least the l2cap_add_psm() routine depends on the source address
type being properly set to know what auto-allocation ranges to use, so
the assignment to l2cap_chan needs to happen before this.

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: L2CAP: Fix auto-allocating LE PSM values</title>
<updated>2016-01-29T10:47:24Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-01-26T22:19:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92594a51120ebc6c2f556204fc73568c8f7cb0f4'/>
<id>urn:sha1:92594a51120ebc6c2f556204fc73568c8f7cb0f4</id>
<content type='text'>
The LE dynamic PSM range is different from BR/EDR (0x0080 - 0x00ff)
and doesn't have requirements relating to parity, so separate checks
are needed.

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: L2CAP: Introduce proper defines for PSM ranges</title>
<updated>2016-01-29T10:47:24Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-01-26T22:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=114f9f1e038eb23935c20fb54f49f07caaa0546d'/>
<id>urn:sha1:114f9f1e038eb23935c20fb54f49f07caaa0546d</id>
<content type='text'>
Having proper defines makes the code a bit readable, it also avoids
duplicating hard-coded values since these are also needed when
auto-allocating PSM values (in a subsequent patch).

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: 6lowpan: Fix handling of uncompressed IPv6 packets</title>
<updated>2016-01-23T12:25:53Z</updated>
<author>
<name>Lukasz Duda</name>
<email>lukasz.duda@nordicsemi.no</email>
</author>
<published>2016-01-13T15:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=87f5fedb3bebbbb566f847dd0c567fcea49a36a6'/>
<id>urn:sha1:87f5fedb3bebbbb566f847dd0c567fcea49a36a6</id>
<content type='text'>
This patch fixes incorrect handling of the 6lowpan packets that contain
uncompressed IPv6 header.

RFC4944 specifies a special dispatch for 6lowpan to carry uncompressed
IPv6 header. This dispatch (1 byte long) has to be removed during
reception and skb data pointer has to be moved. To correctly point in
the beginning of the IPv6 header the dispatch byte has to be pulled off
before packet can be processed by netif_rx_in().

Test scenario: IPv6 packets are not correctly interpreted by the network
layer when IPv6 header is not compressed (e.g. ICMPv6 Echo Reply is not
propagated correctly to the ICMPv6 layer because the extra byte will make
the header look corrupted).

Similar approach is done for IEEE 802.15.4.

Signed-off-by: Lukasz Duda &lt;lukasz.duda@nordicsemi.no&gt;
Signed-off-by: Glenn Ruben Bakke &lt;glenn.ruben.bakke@nordicsemi.no&gt;
Acked-by: Jukka Rissanen &lt;jukka.rissanen@linux.intel.com&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Cc: stable@vger.kernel.org # 4.4+
</content>
</entry>
<entry>
<title>Bluetooth: 6lowpan: Fix kernel NULL pointer dereferences</title>
<updated>2016-01-23T12:21:47Z</updated>
<author>
<name>Glenn Ruben Bakke</name>
<email>glenn.ruben.bakke@nordicsemi.no</email>
</author>
<published>2016-01-13T15:41:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4c58f3282e3de43d34f8955f8eca676294380bf9'/>
<id>urn:sha1:4c58f3282e3de43d34f8955f8eca676294380bf9</id>
<content type='text'>
The fixes provided in this patch assigns a valid net_device structure to
skb before dispatching it for further processing.

Scenario #1:
============

Bluetooth 6lowpan receives an uncompressed IPv6 header, and dispatches it
to netif. The following error occurs:

Null pointer dereference error #1 crash log:

[  845.854013] BUG: unable to handle kernel NULL pointer dereference at
               0000000000000048
[  845.855785] IP: [&lt;ffffffff816e3d36&gt;] enqueue_to_backlog+0x56/0x240
...
[  845.909459] Call Trace:
[  845.911678]  [&lt;ffffffff816e3f64&gt;] netif_rx_internal+0x44/0xf0

The first modification fixes the NULL pointer dereference error by
assigning dev to the local_skb in order to set a valid net_device before
processing the skb by netif_rx_ni().

Scenario #2:
============

Bluetooth 6lowpan receives an UDP compressed message which needs further
decompression by nhc_udp. The following error occurs:

Null pointer dereference error #2 crash log:

[   63.295149] BUG: unable to handle kernel NULL pointer dereference at
               0000000000000840
[   63.295931] IP: [&lt;ffffffffc0559540&gt;] udp_uncompress+0x320/0x626
               [nhc_udp]

The second modification fixes the NULL pointer dereference error by
assigning dev to the local_skb in the case of a udp compressed packet.
The 6lowpan udp_uncompress function expects that the net_device is set in
the skb when checking lltype.

Signed-off-by: Glenn Ruben Bakke &lt;glenn.ruben.bakke@nordicsemi.no&gt;
Signed-off-by: Lukasz Duda &lt;lukasz.duda@nordicsemi.no&gt;
Acked-by: Jukka Rissanen &lt;jukka.rissanen@linux.intel.com&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Cc: stable@vger.kernel.org # 4.4+
</content>
</entry>
<entry>
<title>Bluetooth: avoid rebuilding hci_sock all the time</title>
<updated>2016-01-06T15:36:44Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2016-01-06T13:38:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=787b306cf3296bdce5c8559206b237c1ae107484'/>
<id>urn:sha1:787b306cf3296bdce5c8559206b237c1ae107484</id>
<content type='text'>
Instead, allow using string formatting with send_monitor_note()
and access init_utsname().

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add support for Start Limited Discovery command</title>
<updated>2016-01-05T16:02:50Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-01-05T11:19:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=78b781ca0d35191ebf8d8cad8beec810270f0f2e'/>
<id>urn:sha1:78b781ca0d35191ebf8d8cad8beec810270f0f2e</id>
<content type='text'>
This patch implements the mgmt Start Limited Discovery command. Most
of existing Start Discovery code is reused since the only difference
is the presence of a 'limited' flag as part of the discovery state.

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: Change eir_has_data_type() to more generic eir_get_data()</title>
<updated>2016-01-05T16:02:49Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-01-05T11:19:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d3b7f64c84d53658daf28e2f9772e38acb9340d'/>
<id>urn:sha1:0d3b7f64c84d53658daf28e2f9772e38acb9340d</id>
<content type='text'>
To make the EIR parsing helper more general purpose, make it return
the found data and its length rather than just saying whether the data
was present or not.

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