<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/net/bluetooth/smp.c, branch v3.7</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Bluetooth: Fix error status when pairing fails</title>
<updated>2012-11-09T15:45:37+00:00</updated>
<author>
<name>Paulo Sérgio</name>
<email>paulo.sergio@openbossa.org</email>
</author>
<published>2012-10-25T19:55:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=896ea28ea824d49671fc7e9315d9c5be491a644f'/>
<id>896ea28ea824d49671fc7e9315d9c5be491a644f</id>
<content type='text'>
When pairing fails due to wrong confirm value, the management layer
doesn't report a proper error status. It sends
MGMT_STATUS_CONNECT_FAILED instead of MGMT_STATUS_AUTH_FAILED.

Most of management functions that receive a status as a parameter
expects for it to be encoded as a HCI status. But when a SMP pairing
fails, the SMP layer sends the SMP reason as the error status to the
management layer.

This commit maps all SMP reasons to HCI_ERROR_AUTH_FAILURE, which will
be converted to MGMT_STATUS_AUTH_FAILED in the management layer.

Reported-by: Claudio Takahasi &lt;claudio.takahasi@openbossa.org&gt;
Reviewed-by: João Paulo Rechi Vita &lt;jprvita@openbossa.org&gt;
Signed-off-by: Paulo Sérgio &lt;paulo.sergio@openbossa.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When pairing fails due to wrong confirm value, the management layer
doesn't report a proper error status. It sends
MGMT_STATUS_CONNECT_FAILED instead of MGMT_STATUS_AUTH_FAILED.

Most of management functions that receive a status as a parameter
expects for it to be encoded as a HCI status. But when a SMP pairing
fails, the SMP layer sends the SMP reason as the error status to the
management layer.

This commit maps all SMP reasons to HCI_ERROR_AUTH_FAILURE, which will
be converted to MGMT_STATUS_AUTH_FAILED in the management layer.

Reported-by: Claudio Takahasi &lt;claudio.takahasi@openbossa.org&gt;
Reviewed-by: João Paulo Rechi Vita &lt;jprvita@openbossa.org&gt;
Signed-off-by: Paulo Sérgio &lt;paulo.sergio@openbossa.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: SMP: Fix setting unknown auth_req bits</title>
<updated>2012-10-12T09:55:20+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2012-10-11T14:26:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=065a13e2cc665f6547dc7e8a9d6b6565badf940a'/>
<id>065a13e2cc665f6547dc7e8a9d6b6565badf940a</id>
<content type='text'>
When sending a pairing request or response we should not just blindly
copy the value that the remote device sent. Instead we should at least
make sure to mask out any unknown bits. This is particularly critical
from the upcoming LE Secure Connections feature perspective as
incorrectly indicating support for it (by copying the remote value)
would cause a failure to pair with devices that support it.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Cc: stable@kernel.org
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When sending a pairing request or response we should not just blindly
copy the value that the remote device sent. Instead we should at least
make sure to mask out any unknown bits. This is particularly critical
from the upcoming LE Secure Connections feature perspective as
incorrectly indicating support for it (by copying the remote value)
would cause a failure to pair with devices that support it.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Cc: stable@kernel.org
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Change signature of smp_conn_security()</title>
<updated>2012-08-27T15:07:18+00:00</updated>
<author>
<name>Vinicius Costa Gomes</name>
<email>vinicius.gomes@openbossa.org</email>
</author>
<published>2012-08-24T00:32:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cc110922da7e902b62d18641a370fec01a9fa794'/>
<id>cc110922da7e902b62d18641a370fec01a9fa794</id>
<content type='text'>
To make it clear that it may be called from contexts that may not have
any knowledge of L2CAP, we change the connection parameter, to receive
a hci_conn.

This also makes it clear that it is checking the security of the link.

Signed-off-by: Vinicius Costa Gomes &lt;vinicius.gomes@openbossa.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To make it clear that it may be called from contexts that may not have
any knowledge of L2CAP, we change the connection parameter, to receive
a hci_conn.

This also makes it clear that it is checking the security of the link.

Signed-off-by: Vinicius Costa Gomes &lt;vinicius.gomes@openbossa.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Fix use-after-free bug in SMP</title>
<updated>2012-08-15T04:06:23+00:00</updated>
<author>
<name>Andre Guedes</name>
<email>andre.guedes@openbossa.org</email>
</author>
<published>2012-08-01T23:34:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=61a0cfb008f57ecf7eb28ee762952fb42dc15d15'/>
<id>61a0cfb008f57ecf7eb28ee762952fb42dc15d15</id>
<content type='text'>
If SMP fails, we should always cancel security_timer delayed work.
Otherwise, security_timer function may run after l2cap_conn object
has been freed.

This patch fixes the following warning reported by ODEBUG:

WARNING: at lib/debugobjects.c:261 debug_print_object+0x7c/0x8d()
Hardware name: Bochs
ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x27
Modules linked in: btusb bluetooth
Pid: 440, comm: kworker/u:2 Not tainted 3.5.0-rc1+ #4
Call Trace:
 [&lt;ffffffff81174600&gt;] ? free_obj_work+0x4a/0x7f
 [&lt;ffffffff81023eb8&gt;] warn_slowpath_common+0x7e/0x97
 [&lt;ffffffff81023f65&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff811746b1&gt;] debug_print_object+0x7c/0x8d
 [&lt;ffffffff810394f0&gt;] ? __queue_work+0x241/0x241
 [&lt;ffffffff81174fdd&gt;] debug_check_no_obj_freed+0x92/0x159
 [&lt;ffffffff810ac08e&gt;] slab_free_hook+0x6f/0x77
 [&lt;ffffffffa0019145&gt;] ? l2cap_conn_del+0x148/0x157 [bluetooth]
 [&lt;ffffffff810ae408&gt;] kfree+0x59/0xac
 [&lt;ffffffffa0019145&gt;] l2cap_conn_del+0x148/0x157 [bluetooth]
 [&lt;ffffffffa001b9a2&gt;] l2cap_recv_frame+0xa77/0xfa4 [bluetooth]
 [&lt;ffffffff810592f9&gt;] ? trace_hardirqs_on_caller+0x112/0x1ad
 [&lt;ffffffffa001c86c&gt;] l2cap_recv_acldata+0xe2/0x264 [bluetooth]
 [&lt;ffffffffa0002b2f&gt;] hci_rx_work+0x235/0x33c [bluetooth]
 [&lt;ffffffff81038dc3&gt;] ? process_one_work+0x126/0x2fe
 [&lt;ffffffff81038e22&gt;] process_one_work+0x185/0x2fe
 [&lt;ffffffff81038dc3&gt;] ? process_one_work+0x126/0x2fe
 [&lt;ffffffff81059f2e&gt;] ? lock_acquired+0x1b5/0x1cf
 [&lt;ffffffffa00028fa&gt;] ? le_scan_work+0x11d/0x11d [bluetooth]
 [&lt;ffffffff81036fb6&gt;] ? spin_lock_irq+0x9/0xb
 [&lt;ffffffff81039209&gt;] worker_thread+0xcf/0x175
 [&lt;ffffffff8103913a&gt;] ? rescuer_thread+0x175/0x175
 [&lt;ffffffff8103cfe0&gt;] kthread+0x95/0x9d
 [&lt;ffffffff812c5054&gt;] kernel_threadi_helper+0x4/0x10
 [&lt;ffffffff812c36b0&gt;] ? retint_restore_args+0x13/0x13
 [&lt;ffffffff8103cf4b&gt;] ? flush_kthread_worker+0xdb/0xdb
 [&lt;ffffffff812c5050&gt;] ? gs_change+0x13/0x13

This bug can be reproduced using hctool lecc or l2test tools and
bluetoothd not running.

Signed-off-by: Andre Guedes &lt;andre.guedes@openbossa.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If SMP fails, we should always cancel security_timer delayed work.
Otherwise, security_timer function may run after l2cap_conn object
has been freed.

This patch fixes the following warning reported by ODEBUG:

WARNING: at lib/debugobjects.c:261 debug_print_object+0x7c/0x8d()
Hardware name: Bochs
ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x27
Modules linked in: btusb bluetooth
Pid: 440, comm: kworker/u:2 Not tainted 3.5.0-rc1+ #4
Call Trace:
 [&lt;ffffffff81174600&gt;] ? free_obj_work+0x4a/0x7f
 [&lt;ffffffff81023eb8&gt;] warn_slowpath_common+0x7e/0x97
 [&lt;ffffffff81023f65&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff811746b1&gt;] debug_print_object+0x7c/0x8d
 [&lt;ffffffff810394f0&gt;] ? __queue_work+0x241/0x241
 [&lt;ffffffff81174fdd&gt;] debug_check_no_obj_freed+0x92/0x159
 [&lt;ffffffff810ac08e&gt;] slab_free_hook+0x6f/0x77
 [&lt;ffffffffa0019145&gt;] ? l2cap_conn_del+0x148/0x157 [bluetooth]
 [&lt;ffffffff810ae408&gt;] kfree+0x59/0xac
 [&lt;ffffffffa0019145&gt;] l2cap_conn_del+0x148/0x157 [bluetooth]
 [&lt;ffffffffa001b9a2&gt;] l2cap_recv_frame+0xa77/0xfa4 [bluetooth]
 [&lt;ffffffff810592f9&gt;] ? trace_hardirqs_on_caller+0x112/0x1ad
 [&lt;ffffffffa001c86c&gt;] l2cap_recv_acldata+0xe2/0x264 [bluetooth]
 [&lt;ffffffffa0002b2f&gt;] hci_rx_work+0x235/0x33c [bluetooth]
 [&lt;ffffffff81038dc3&gt;] ? process_one_work+0x126/0x2fe
 [&lt;ffffffff81038e22&gt;] process_one_work+0x185/0x2fe
 [&lt;ffffffff81038dc3&gt;] ? process_one_work+0x126/0x2fe
 [&lt;ffffffff81059f2e&gt;] ? lock_acquired+0x1b5/0x1cf
 [&lt;ffffffffa00028fa&gt;] ? le_scan_work+0x11d/0x11d [bluetooth]
 [&lt;ffffffff81036fb6&gt;] ? spin_lock_irq+0x9/0xb
 [&lt;ffffffff81039209&gt;] worker_thread+0xcf/0x175
 [&lt;ffffffff8103913a&gt;] ? rescuer_thread+0x175/0x175
 [&lt;ffffffff8103cfe0&gt;] kthread+0x95/0x9d
 [&lt;ffffffff812c5054&gt;] kernel_threadi_helper+0x4/0x10
 [&lt;ffffffff812c36b0&gt;] ? retint_restore_args+0x13/0x13
 [&lt;ffffffff8103cf4b&gt;] ? flush_kthread_worker+0xdb/0xdb
 [&lt;ffffffff812c5050&gt;] ? gs_change+0x13/0x13

This bug can be reproduced using hctool lecc or l2test tools and
bluetoothd not running.

Signed-off-by: Andre Guedes &lt;andre.guedes@openbossa.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: smp: Fix possible NULL dereference</title>
<updated>2012-08-06T18:19:37+00:00</updated>
<author>
<name>Andrei Emeltchenko</name>
<email>andrei.emeltchenko@intel.com</email>
</author>
<published>2012-07-19T14:03:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d08fd0e712a834d4abb869c0215a702e290bc51e'/>
<id>d08fd0e712a834d4abb869c0215a702e290bc51e</id>
<content type='text'>
smp_chan_create might return NULL so we need to check before
dereferencing smp.

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@intel.com&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
smp_chan_create might return NULL so we need to check before
dereferencing smp.

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@intel.com&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless</title>
<updated>2012-06-13T19:35:35+00:00</updated>
<author>
<name>John W. Linville</name>
<email>linville@tuxdriver.com</email>
</author>
<published>2012-06-13T19:35:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=211c17aaee644bb808fbdeef547ac99db92c01ed'/>
<id>211c17aaee644bb808fbdeef547ac99db92c01ed</id>
<content type='text'>
Conflicts:
	drivers/net/wireless/ath/ath9k/main.c
	net/bluetooth/hci_event.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Conflicts:
	drivers/net/wireless/ath/ath9k/main.c
	net/bluetooth/hci_event.c
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Fix SMP security elevation from medium to high</title>
<updated>2012-06-08T06:58:34+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2012-06-07T06:58:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4dab786482d706a2a41cd16cf174671d640a9870'/>
<id>4dab786482d706a2a41cd16cf174671d640a9870</id>
<content type='text'>
If we have an unauthenticated key it is not sufficient to acheive high
security. Therefore, when deciding whether to encrypt the link or
request pairing, it is essential to in addition to checking the
existence of a key to also check whether it is authenticated or not.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If we have an unauthenticated key it is not sufficient to acheive high
security. Therefore, when deciding whether to encrypt the link or
request pairing, it is essential to in addition to checking the
existence of a key to also check whether it is authenticated or not.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Fix SMP pairing method selection</title>
<updated>2012-06-08T04:50:15+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2012-06-06T10:54:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=476585ecf08067ac4e81d1a4cb19e2caf2093471'/>
<id>476585ecf08067ac4e81d1a4cb19e2caf2093471</id>
<content type='text'>
The tk_request function takes the local IO capability as the second last
parameter and the remote IO capability as the last parameter. They were
previously swapped: when we receive a pairing response
req-&gt;io_capability contains the local one and rsp-&gt;io_capability the
remote one.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tk_request function takes the local IO capability as the second last
parameter and the remote IO capability as the last parameter. They were
previously swapped: when we receive a pairing response
req-&gt;io_capability contains the local one and rsp-&gt;io_capability the
remote one.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Remove unnecessary headers include</title>
<updated>2012-06-05T03:34:08+00:00</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2012-05-23T07:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8c520a59927a5600973782505dbb750d985057c4'/>
<id>8c520a59927a5600973782505dbb750d985057c4</id>
<content type='text'>
Most of the include were unnecessary or already included by some other
header.
Replace module.h by export.h where possible.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most of the include were unnecessary or already included by some other
header.
Replace module.h by export.h where possible.

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Bluetooth: Correct ediv in SMP</title>
<updated>2012-05-09T03:41:30+00:00</updated>
<author>
<name>Andrei Emeltchenko</name>
<email>andrei.emeltchenko@intel.com</email>
</author>
<published>2012-03-12T10:13:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=58115373e74c7ee18d0f54f00831649a6471a899'/>
<id>58115373e74c7ee18d0f54f00831649a6471a899</id>
<content type='text'>
ediv is already in little endian order.

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ediv is already in little endian order.

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