<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/net/bluetooth/rfcomm.h, branch v3.12.13</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.12.13</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.12.13'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2013-03-08T13:40:24+00:00</updated>
<entry>
<title>Bluetooth: Remove RFCOMM session refcnt</title>
<updated>2013-03-08T13:40:24+00:00</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2013-02-28T14:21:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=08c30aca9e698faddebd34f81e1196295f9dc063'/>
<id>urn:sha1:08c30aca9e698faddebd34f81e1196295f9dc063</id>
<content type='text'>
Previous commits have improved the handling of the RFCOMM session
timer and the RFCOMM session pointers such that freed RFCOMM
session structures should no longer be erroneously accessed. The
RFCOMM session refcnt now has no purpose and will be deleted by
this commit.

Note that the RFCOMM session is now deleted as soon as the
RFCOMM control channel link is no longer required. This makes the
lifetime of the RFCOMM session deterministic and absolute.
Previously with the refcnt, there was uncertainty about when
the session structure would be deleted because the relative
refcnt prevented the session structure from being deleted at will.

It was noted that the refcnt could malfunction under very heavy
real-time processor loading in embedded SMP environments. This
could cause premature RFCOMM session deletion or double session
deletion that could result in kernel crashes. Removal of the
refcnt prevents this issue.

There are 4 connection / disconnection RFCOMM session scenarios:
host initiated control link ---&gt; host disconnected control link
host initiated ctrl link ---&gt; remote device disconnected ctrl link
remote device initiated ctrl link ---&gt; host disconnected ctrl link
remote device initiated ctrl link ---&gt; remote device disc'ed ctrl link

The control channel connection procedures are independent of the
disconnection procedures. Strangely, the RFCOMM session refcnt was
applying special treatment so erroneously combining connection and
disconnection events. This commit fixes this issue by removing
some session code that used the "initiator" member of the session
structure that was intended for use with the data channels.

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Return RFCOMM session ptrs to avoid freed session</title>
<updated>2013-03-08T13:40:24+00:00</updated>
<author>
<name>Dean Jenkins</name>
<email>Dean_Jenkins@mentor.com</email>
</author>
<published>2013-02-28T14:21:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ff52f7d04d9cc31f1e81dcf9a2ba6335ed34905'/>
<id>urn:sha1:8ff52f7d04d9cc31f1e81dcf9a2ba6335ed34905</id>
<content type='text'>
Unfortunately, the design retains local copies of the s RFCOMM
session pointer in various code blocks and this invites the erroneous
access to a freed RFCOMM session structure.

Therefore, return the RFCOMM session pointer back up the call stack
to avoid accessing a freed RFCOMM session structure. When the RFCOMM
session is deleted, NULL is passed up the call stack.

If active DLCs exist when the rfcomm session is terminating,
avoid a memory leak of rfcomm_dlc structures by ensuring that
rfcomm_session_close() is used instead of rfcomm_session_del().

Signed-off-by: Dean Jenkins &lt;Dean_Jenkins@mentor.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
</content>
</entry>
<entry>
<title>Bluetooth: rfcomm: Fix sleep in invalid context in rfcomm_security_cfm</title>
<updated>2011-10-14T18:04:54+00:00</updated>
<author>
<name>Szymon Janc</name>
<email>szymon.janc@tieto.com</email>
</author>
<published>2011-09-26T12:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=88149db4948ef90cf6220d76e34955e46c2ff9f9'/>
<id>urn:sha1:88149db4948ef90cf6220d76e34955e46c2ff9f9</id>
<content type='text'>
This was triggered by turning off encryption on ACL link when rfcomm
was using high security. rfcomm_security_cfm (which is called from rx
task) was closing DLC and this involves sending disconnect message
(and locking socket).

Move closing DLC to rfcomm_process_dlcs and only flag DLC for closure
in rfcomm_security_cfm.

BUG: sleeping function called from invalid context at net/core/sock.c:2032
in_atomic(): 1, irqs_disabled(): 0, pid: 1788, name: kworker/0:3
[&lt;c0068a08&gt;] (unwind_backtrace+0x0/0x108) from [&lt;c05e25dc&gt;] (dump_stack+0x20/0x24)
[&lt;c05e25dc&gt;] (dump_stack+0x20/0x24) from [&lt;c0087ba8&gt;] (__might_sleep+0x110/0x12c)
[&lt;c0087ba8&gt;] (__might_sleep+0x110/0x12c) from [&lt;c04801d8&gt;] (lock_sock_nested+0x2c/0x64)
[&lt;c04801d8&gt;] (lock_sock_nested+0x2c/0x64) from [&lt;c05670c8&gt;] (l2cap_sock_sendmsg+0x58/0xcc)
[&lt;c05670c8&gt;] (l2cap_sock_sendmsg+0x58/0xcc) from [&lt;c047cf6c&gt;] (sock_sendmsg+0xb0/0xd0)
[&lt;c047cf6c&gt;] (sock_sendmsg+0xb0/0xd0) from [&lt;c047cfc8&gt;] (kernel_sendmsg+0x3c/0x44)
[&lt;c047cfc8&gt;] (kernel_sendmsg+0x3c/0x44) from [&lt;c056b0e8&gt;] (rfcomm_send_frame+0x50/0x58)
[&lt;c056b0e8&gt;] (rfcomm_send_frame+0x50/0x58) from [&lt;c056b168&gt;] (rfcomm_send_disc+0x78/0x80)
[&lt;c056b168&gt;] (rfcomm_send_disc+0x78/0x80) from [&lt;c056b9f4&gt;] (__rfcomm_dlc_close+0x2d0/0x2fc)
[&lt;c056b9f4&gt;] (__rfcomm_dlc_close+0x2d0/0x2fc) from [&lt;c056bbac&gt;] (rfcomm_security_cfm+0x140/0x1e0)
[&lt;c056bbac&gt;] (rfcomm_security_cfm+0x140/0x1e0) from [&lt;c0555ec0&gt;] (hci_event_packet+0x1ce8/0x4d84)
[&lt;c0555ec0&gt;] (hci_event_packet+0x1ce8/0x4d84) from [&lt;c0550380&gt;] (hci_rx_task+0x1d0/0x2d0)
[&lt;c0550380&gt;] (hci_rx_task+0x1d0/0x2d0) from [&lt;c009ee04&gt;] (tasklet_action+0x138/0x1e4)
[&lt;c009ee04&gt;] (tasklet_action+0x138/0x1e4) from [&lt;c009f21c&gt;] (__do_softirq+0xcc/0x274)
[&lt;c009f21c&gt;] (__do_softirq+0xcc/0x274) from [&lt;c009f6c0&gt;] (do_softirq+0x60/0x6c)
[&lt;c009f6c0&gt;] (do_softirq+0x60/0x6c) from [&lt;c009f794&gt;] (local_bh_enable_ip+0xc8/0xd4)
[&lt;c009f794&gt;] (local_bh_enable_ip+0xc8/0xd4) from [&lt;c05e5804&gt;] (_raw_spin_unlock_bh+0x48/0x4c)
[&lt;c05e5804&gt;] (_raw_spin_unlock_bh+0x48/0x4c) from [&lt;c040d470&gt;] (data_from_chip+0xf4/0xaec)
[&lt;c040d470&gt;] (data_from_chip+0xf4/0xaec) from [&lt;c04136c0&gt;] (send_skb_to_core+0x40/0x178)
[&lt;c04136c0&gt;] (send_skb_to_core+0x40/0x178) from [&lt;c04139f4&gt;] (cg2900_hu_receive+0x15c/0x2d0)
[&lt;c04139f4&gt;] (cg2900_hu_receive+0x15c/0x2d0) from [&lt;c0414cb8&gt;] (hci_uart_tty_receive+0x74/0xa0)
[&lt;c0414cb8&gt;] (hci_uart_tty_receive+0x74/0xa0) from [&lt;c02cbd9c&gt;] (flush_to_ldisc+0x188/0x198)
[&lt;c02cbd9c&gt;] (flush_to_ldisc+0x188/0x198) from [&lt;c00b2774&gt;] (process_one_work+0x144/0x4b8)
[&lt;c00b2774&gt;] (process_one_work+0x144/0x4b8) from [&lt;c00b2e8c&gt;] (worker_thread+0x198/0x468)
[&lt;c00b2e8c&gt;] (worker_thread+0x198/0x468) from [&lt;c00b9bc8&gt;] (kthread+0x98/0xa0)
[&lt;c00b9bc8&gt;] (kthread+0x98/0xa0) from [&lt;c0061744&gt;] (kernel_thread_exit+0x0/0x8)

Signed-off-by: Szymon Janc &lt;szymon.janc@tieto.com&gt;
Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Clean up some code style issues</title>
<updated>2011-06-09T19:33:28+00:00</updated>
<author>
<name>Waldemar Rymarkiewicz</name>
<email>waldemar.rymarkiewicz@tieto.com</email>
</author>
<published>2011-06-07T09:18:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a9d0a3ffbc40ea1f5a0636501e7599cbb327bcc'/>
<id>urn:sha1:5a9d0a3ffbc40ea1f5a0636501e7599cbb327bcc</id>
<content type='text'>
Fix lines longer than 80 chars in length.

Signed-off-by: Waldemar Rymarkiewicz &lt;waldemar.rymarkiewicz@tieto.com&gt;
Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>Bluetooth: clean up legal text</title>
<updated>2010-12-01T23:04:43+00:00</updated>
<author>
<name>Andrei Emeltchenko</name>
<email>andrei.emeltchenko@nokia.com</email>
</author>
<published>2010-12-01T14:58:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be21871f24b0fcd8d0d09c8090385c9cec80efa3'/>
<id>urn:sha1:be21871f24b0fcd8d0d09c8090385c9cec80efa3</id>
<content type='text'>
Remove extra spaces from legal text so that legal stuff looks
the same for all bluetooth code.

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@nokia.com&gt;
Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>Bluetooth: clean up rfcomm code</title>
<updated>2010-12-01T23:04:43+00:00</updated>
<author>
<name>Andrei Emeltchenko</name>
<email>andrei.emeltchenko@nokia.com</email>
</author>
<published>2010-12-01T14:58:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=285b4e90318dcf421a00b2ac3fe8ab713f3281e3'/>
<id>urn:sha1:285b4e90318dcf421a00b2ac3fe8ab713f3281e3</id>
<content type='text'>
Remove extra spaces, assignments in if statement, zeroing static
variables, extra braces. Fix includes.

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@nokia.com&gt;
Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>Bluetooth: clean up rfcomm code</title>
<updated>2010-10-12T15:44:53+00:00</updated>
<author>
<name>Andrei Emeltchenko</name>
<email>andrei.emeltchenko@nokia.com</email>
</author>
<published>2010-10-01T09:05:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=534c92fde74c8d2143fc15b5f1d957f42cb43570'/>
<id>urn:sha1:534c92fde74c8d2143fc15b5f1d957f42cb43570</id>
<content type='text'>
Remove dead code and unused rfcomm thread events

Signed-off-by: Andrei Emeltchenko &lt;andrei.emeltchenko@nokia.com&gt;
Acked-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Use __packed annotation</title>
<updated>2010-07-21T17:39:13+00:00</updated>
<author>
<name>Gustavo F. Padovan</name>
<email>padovan@profusion.mobi</email>
</author>
<published>2010-07-19T05:00:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=66c853cc21bd387a9a2109dcf3b3d53cc9ee9edf'/>
<id>urn:sha1:66c853cc21bd387a9a2109dcf3b3d53cc9ee9edf</id>
<content type='text'>
To make net/ and include/net/ code consistent use __packed instead of
__attribute__ ((packed)). Bluetooth subsystem was one of the last net
subsys still using __attribute__ ((packed)).

Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix rejected connection not disconnecting ACL link</title>
<updated>2009-08-22T22:05:58+00:00</updated>
<author>
<name>Luiz Augusto von Dentz</name>
<email>luiz.dentz@openbossa.org</email>
</author>
<published>2009-07-15T16:50:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9e726b17422bade75fba94e625cd35fd1353e682'/>
<id>urn:sha1:9e726b17422bade75fba94e625cd35fd1353e682</id>
<content type='text'>
When using DEFER_SETUP on a RFCOMM socket, a SABM frame triggers
authorization which when rejected send a DM response. This is fine
according to the RFCOMM spec:

    the responding implementation may replace the "proper" response
    on the Multiplexer Control channel with a DM frame, sent on the
    referenced DLCI to indicate that the DLCI is not open, and that
    the responder would not grant a request to open it later either.

But some stacks doesn't seems to cope with this leaving DLCI 0 open after
receiving DM frame.

To fix it properly a timer was introduced to rfcomm_session which is used
to set a timeout when the last active DLC of a session is unlinked, this
will give the remote stack some time to reply with a proper DISC frame on
DLCI 0 avoiding both sides sending DISC to each other on stacks that
follow the specification and taking care of those who don't by taking
down DLCI 0.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.dentz@openbossa.org&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>bluetooth: rfcomm_init bug fix</title>
<updated>2009-08-03T20:24:39+00:00</updated>
<author>
<name>Dave Young</name>
<email>hidave.darkstar@gmail.com</email>
</author>
<published>2009-08-03T04:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=af0d3b103bcfa877343ee338de12002cd50c9ee5'/>
<id>urn:sha1:af0d3b103bcfa877343ee338de12002cd50c9ee5</id>
<content type='text'>
rfcomm tty may be used before rfcomm_tty_driver initilized,
The problem is that now socket layer init before tty layer, if userspace
program do socket callback right here then oops will happen.

reporting in:
http://marc.info/?l=linux-bluetooth&amp;m=124404919324542&amp;w=2

make 3 changes:
1. remove #ifdef in rfcomm/core.c,
make it blank function when rfcomm tty not selected in rfcomm.h

2. tune the rfcomm_init error patch to ensure
tty driver initilized before rfcomm socket usage.

3. remove __exit for rfcomm_cleanup_sockets
because above change need call it in a __init function.

Reported-by: Oliver Hartkopp &lt;oliver@hartkopp.net&gt;
Tested-by: Oliver Hartkopp &lt;oliver@hartkopp.net&gt;
Signed-off-by: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
