<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/bluetooth, branch v3.3</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=v3.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-02-15T11:09:26Z</updated>
<entry>
<title>Bluetooth: Fix possible use after free in delete path</title>
<updated>2012-02-15T11:09:26Z</updated>
<author>
<name>Ulisses Furquim</name>
<email>ulisses@profusion.mobi</email>
</author>
<published>2012-01-30T20:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=24d2b8c0ac5c8ec41c26ed432238b0e027184882'/>
<id>urn:sha1:24d2b8c0ac5c8ec41c26ed432238b0e027184882</id>
<content type='text'>
We need to use the _sync() version for cancelling the info and security
timer in the L2CAP connection delete path. Otherwise the delayed work
handler might run after the connection object is freed.

Signed-off-by: Ulisses Furquim &lt;ulisses@profusion.mobi&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Remove usage of __cancel_delayed_work()</title>
<updated>2012-02-15T11:09:26Z</updated>
<author>
<name>Ulisses Furquim</name>
<email>ulisses@profusion.mobi</email>
</author>
<published>2012-01-30T20:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6de32750822d00bfa92c341166132b0714c5b559'/>
<id>urn:sha1:6de32750822d00bfa92c341166132b0714c5b559</id>
<content type='text'>
__cancel_delayed_work() is being used in some paths where we cannot
sleep waiting for the delayed work to finish. However, that function
might return while the timer is running and the work will be queued
again. Replace the calls with safer cancel_delayed_work() version
which spins until the timer handler finishes on other CPUs and
cancels the delayed work.

Signed-off-by: Ulisses Furquim &lt;ulisses@profusion.mobi&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add missing QUIRK_NO_RESET test to hci_dev_do_close</title>
<updated>2012-02-15T11:09:26Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2012-02-03T19:29:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ca0d6c7ece0e78268cd7c5c378d6b1b610625085'/>
<id>urn:sha1:ca0d6c7ece0e78268cd7c5c378d6b1b610625085</id>
<content type='text'>
We should only perform a reset in hci_dev_do_close if the
HCI_QUIRK_NO_RESET flag is set (since in such a case a reset will not be
performed when initializing the device).

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix RFCOMM session reference counting issue</title>
<updated>2012-02-15T11:09:26Z</updated>
<author>
<name>Octavian Purdila</name>
<email>octavian.purdila@intel.com</email>
</author>
<published>2012-01-27T17:32:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf33e77b76d7439f21a23a94eab4ab3b405a6a7d'/>
<id>urn:sha1:cf33e77b76d7439f21a23a94eab4ab3b405a6a7d</id>
<content type='text'>
There is an imbalance in the rfcomm_session_hold / rfcomm_session_put
operations which causes the following crash:

[  685.010159] BUG: unable to handle kernel paging request at 6b6b6b6b
[  685.010169] IP: [&lt;c149d76d&gt;] rfcomm_process_dlcs+0x1b/0x15e
[  685.010181] *pdpt = 000000002d665001 *pde = 0000000000000000
[  685.010191] Oops: 0000 [#1] PREEMPT SMP
[  685.010247]
[  685.010255] Pid: 947, comm: krfcommd Tainted: G         C  3.0.16-mid8-dirty #44
[  685.010266] EIP: 0060:[&lt;c149d76d&gt;] EFLAGS: 00010246 CPU: 1
[  685.010274] EIP is at rfcomm_process_dlcs+0x1b/0x15e
[  685.010281] EAX: e79f551c EBX: 6b6b6b6b ECX: 00000007 EDX: e79f40b4
[  685.010288] ESI: e79f4060 EDI: ed4e1f70 EBP: ed4e1f68 ESP: ed4e1f50
[  685.010295]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[  685.010303] Process krfcommd (pid: 947, ti=ed4e0000 task=ed43e5e0 task.ti=ed4e0000)
[  685.010308] Stack:
[  685.010312]  ed4e1f68 c149eb53 e5925150 e79f4060 ed500000 ed4e1f70 ed4e1f80 c149ec10
[  685.010331]  00000000 ed43e5e0 00000000 ed4e1f90 ed4e1f9c c149ec87 0000bf54 00000000
[  685.010348]  00000000 ee03bf54 c149ec37 ed4e1fe4 c104fe01 00000000 00000000 00000000
[  685.010367] Call Trace:
[  685.010376]  [&lt;c149eb53&gt;] ? rfcomm_process_rx+0x6e/0x74
[  685.010387]  [&lt;c149ec10&gt;] rfcomm_process_sessions+0xb7/0xde
[  685.010398]  [&lt;c149ec87&gt;] rfcomm_run+0x50/0x6d
[  685.010409]  [&lt;c149ec37&gt;] ? rfcomm_process_sessions+0xde/0xde
[  685.010419]  [&lt;c104fe01&gt;] kthread+0x63/0x68
[  685.010431]  [&lt;c104fd9e&gt;] ? __init_kthread_worker+0x42/0x42
[  685.010442]  [&lt;c14dae82&gt;] kernel_thread_helper+0x6/0xd

This issue has been brought up earlier here:

https://lkml.org/lkml/2011/5/21/127

The issue appears to be the rfcomm_session_put in rfcomm_recv_ua. This
operation doesn't seem be to required as for the non-initiator case we
have the rfcomm_process_rx doing an explicit put and in the initiator
case the last dlc_unlink will drive the reference counter to 0.

There have been several attempts to fix these issue:

6c2718d Bluetooth: Do not call rfcomm_session_put() for RFCOMM UA on closed socket
683d949 Bluetooth: Never deallocate a session when some DLC points to it

but AFAICS they do not fix the issue just make it harder to reproduce.

Signed-off-by: Octavian Purdila &lt;octavian.purdila@intel.com&gt;
Signed-off-by: Gopala Krishna Murala &lt;gopala.krishna.murala@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: silence lockdep warning</title>
<updated>2012-02-15T11:09:26Z</updated>
<author>
<name>Octavian Purdila</name>
<email>tavi.purdila@gmail.com</email>
</author>
<published>2012-01-21T22:28:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b5a30dda6598af216c070165ece6068f9f00f33a'/>
<id>urn:sha1:b5a30dda6598af216c070165ece6068f9f00f33a</id>
<content type='text'>
Since bluetooth uses multiple protocols types, to avoid lockdep
warnings, we need to use different lockdep classes (one for each
protocol type).

This is already done in bt_sock_create but it misses a couple of cases
when new connections are created. This patch corrects that to fix the
following warning:

&lt;4&gt;[ 1864.732366] =======================================================
&lt;4&gt;[ 1864.733030] [ INFO: possible circular locking dependency detected ]
&lt;4&gt;[ 1864.733544] 3.0.16-mid3-00007-gc9a0f62 #3
&lt;4&gt;[ 1864.733883] -------------------------------------------------------
&lt;4&gt;[ 1864.734408] t.android.btclc/4204 is trying to acquire lock:
&lt;4&gt;[ 1864.734869]  (rfcomm_mutex){+.+.+.}, at: [&lt;c14970ea&gt;] rfcomm_dlc_close+0x15/0x30
&lt;4&gt;[ 1864.735541]
&lt;4&gt;[ 1864.735549] but task is already holding lock:
&lt;4&gt;[ 1864.736045]  (sk_lock-AF_BLUETOOTH){+.+.+.}, at: [&lt;c1498bf7&gt;] lock_sock+0xa/0xc
&lt;4&gt;[ 1864.736732]
&lt;4&gt;[ 1864.736740] which lock already depends on the new lock.
&lt;4&gt;[ 1864.736750]
&lt;4&gt;[ 1864.737428]
&lt;4&gt;[ 1864.737437] the existing dependency chain (in reverse order) is:
&lt;4&gt;[ 1864.738016]
&lt;4&gt;[ 1864.738023] -&gt; #1 (sk_lock-AF_BLUETOOTH){+.+.+.}:
&lt;4&gt;[ 1864.738549]        [&lt;c1062273&gt;] lock_acquire+0x104/0x140
&lt;4&gt;[ 1864.738977]        [&lt;c13d35c1&gt;] lock_sock_nested+0x58/0x68
&lt;4&gt;[ 1864.739411]        [&lt;c1493c33&gt;] l2cap_sock_sendmsg+0x3e/0x76
&lt;4&gt;[ 1864.739858]        [&lt;c13d06c3&gt;] __sock_sendmsg+0x50/0x59
&lt;4&gt;[ 1864.740279]        [&lt;c13d0ea2&gt;] sock_sendmsg+0x94/0xa8
&lt;4&gt;[ 1864.740687]        [&lt;c13d0ede&gt;] kernel_sendmsg+0x28/0x37
&lt;4&gt;[ 1864.741106]        [&lt;c14969ca&gt;] rfcomm_send_frame+0x30/0x38
&lt;4&gt;[ 1864.741542]        [&lt;c1496a2a&gt;] rfcomm_send_ua+0x58/0x5a
&lt;4&gt;[ 1864.741959]        [&lt;c1498447&gt;] rfcomm_run+0x441/0xb52
&lt;4&gt;[ 1864.742365]        [&lt;c104f095&gt;] kthread+0x63/0x68
&lt;4&gt;[ 1864.742742]        [&lt;c14d5182&gt;] kernel_thread_helper+0x6/0xd
&lt;4&gt;[ 1864.743187]
&lt;4&gt;[ 1864.743193] -&gt; #0 (rfcomm_mutex){+.+.+.}:
&lt;4&gt;[ 1864.743667]        [&lt;c1061ada&gt;] __lock_acquire+0x988/0xc00
&lt;4&gt;[ 1864.744100]        [&lt;c1062273&gt;] lock_acquire+0x104/0x140
&lt;4&gt;[ 1864.744519]        [&lt;c14d2c70&gt;] __mutex_lock_common+0x3b/0x33f
&lt;4&gt;[ 1864.744975]        [&lt;c14d303e&gt;] mutex_lock_nested+0x2d/0x36
&lt;4&gt;[ 1864.745412]        [&lt;c14970ea&gt;] rfcomm_dlc_close+0x15/0x30
&lt;4&gt;[ 1864.745842]        [&lt;c14990d9&gt;] __rfcomm_sock_close+0x5f/0x6b
&lt;4&gt;[ 1864.746288]        [&lt;c1499114&gt;] rfcomm_sock_shutdown+0x2f/0x62
&lt;4&gt;[ 1864.746737]        [&lt;c13d275d&gt;] sys_socketcall+0x1db/0x422
&lt;4&gt;[ 1864.747165]        [&lt;c14d42f0&gt;] syscall_call+0x7/0xb

Signed-off-by: Octavian Purdila &lt;octavian.purdila@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: l2cap_set_timer needs jiffies as timeout value</title>
<updated>2012-02-15T11:09:25Z</updated>
<author>
<name>Andrzej Kaczmarek</name>
<email>andrzej.kaczmarek@tieto.com</email>
</author>
<published>2012-01-04T11:10:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6e1da683f79a22fafaada62d547138daaa9e3456'/>
<id>urn:sha1:6e1da683f79a22fafaada62d547138daaa9e3456</id>
<content type='text'>
After moving L2CAP timers to workqueues l2cap_set_timer expects timeout
value to be specified in jiffies but constants defined in miliseconds
are used. This makes timeouts unreliable when CONFIG_HZ is not set to
1000.

__set_chan_timer macro still uses jiffies as input to avoid multiple
conversions from/to jiffies for sk_sndtimeo value which is already
specified in jiffies.

Signed-off-by: Andrzej Kaczmarek &lt;andrzej.kaczmarek@tieto.com&gt;
Ackec-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix sk_sndtimeo initialization for L2CAP socket</title>
<updated>2012-02-15T11:09:25Z</updated>
<author>
<name>Andrzej Kaczmarek</name>
<email>andrzej.kaczmarek@tieto.com</email>
</author>
<published>2012-01-04T11:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a63752552b95624a9f1dfa3d763870f72f964ad0'/>
<id>urn:sha1:a63752552b95624a9f1dfa3d763870f72f964ad0</id>
<content type='text'>
sk_sndtime value should be specified in jiffies thus initial value
needs to be converted from miliseconds. Otherwise this timeout is
unreliable when CONFIG_HZ is not set to 1000.

Signed-off-by: Andrzej Kaczmarek &lt;andrzej.kaczmarek@tieto.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Remove bogus inline declaration from l2cap_chan_connect</title>
<updated>2012-02-15T11:09:25Z</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2012-01-08T20:51:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4aa832c27edf902130f8bace1d42cf22468823fa'/>
<id>urn:sha1:4aa832c27edf902130f8bace1d42cf22468823fa</id>
<content type='text'>
As reported by Dan Carpenter this function causes a Sparse warning and
shouldn't be declared inline:

include/net/bluetooth/l2cap.h:837:30 error: marked inline, but without a
definition"

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix l2cap conn failures for ssp devices</title>
<updated>2012-02-15T11:09:25Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2012-01-13T14:11:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18daf1644e634bae951a6e3d4d19d89170209762'/>
<id>urn:sha1:18daf1644e634bae951a6e3d4d19d89170209762</id>
<content type='text'>
Commit 330605423c fixed l2cap conn establishment for non-ssp remote
devices by not setting HCI_CONN_ENCRYPT_PEND every time conn security
is tested (which was always returning failure on any subsequent
security checks).

However, this broke l2cap conn establishment for ssp remote devices
when an ACL link was already established at SDP-level security. This
fix ensures that encryption must be pending whenever authentication
is also pending.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Tested-by: Daniel Wagner &lt;daniel.wagner@bmw-carit.de&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>bluetooth: hci: Fix type of "enable_hs" to bool.</title>
<updated>2012-01-22T20:08:46Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-01-22T19:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1cc16b8e643096adb92bbcb76c6c4c564141c40'/>
<id>urn:sha1:b1cc16b8e643096adb92bbcb76c6c4c564141c40</id>
<content type='text'>
Fixes:

net/bluetooth/hci_core.c: In function ‘__check_enable_hs’:
net/bluetooth/hci_core.c:2587:1: warning: return from incompatible pointer type [enabled by default]

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
