<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/bluetooth/rfcomm, branch v3.2.38</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/net/bluetooth/rfcomm?h=v3.2.38</id>
<link rel='self' href='https://git.amat.us/linux/atom/net/bluetooth/rfcomm?h=v3.2.38'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-01-03T03:33:27Z</updated>
<entry>
<title>Bluetooth: Add missing lock nesting notation</title>
<updated>2013-01-03T03:33:27Z</updated>
<author>
<name>Gustavo Padovan</name>
<email>gustavo.padovan@collabora.co.uk</email>
</author>
<published>2012-11-21T01:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=37021f68aa5cfe2b838bea7dfdeae99d7c9bdc6e'/>
<id>urn:sha1:37021f68aa5cfe2b838bea7dfdeae99d7c9bdc6e</id>
<content type='text'>
commit dc2a0e20fbc85a71c63aa4330b496fda33f6bf80 upstream.

This patch fixes the following report, it happens when accepting rfcomm
connections:

[  228.165378] =============================================
[  228.165378] [ INFO: possible recursive locking detected ]
[  228.165378] 3.7.0-rc1-00536-gc1d5dc4 #120 Tainted: G        W
[  228.165378] ---------------------------------------------
[  228.165378] bluetoothd/1341 is trying to acquire lock:
[  228.165378]  (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+...}, at:
[&lt;ffffffffa0000aa0&gt;] bt_accept_dequeue+0xa0/0x180 [bluetooth]
[  228.165378]
[  228.165378] but task is already holding lock:
[  228.165378]  (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+...}, at:
[&lt;ffffffffa0205118&gt;] rfcomm_sock_accept+0x58/0x2d0 [rfcomm]
[  228.165378]
[  228.165378] other info that might help us debug this:
[  228.165378]  Possible unsafe locking scenario:
[  228.165378]
[  228.165378]        CPU0
[  228.165378]        ----
[  228.165378]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
[  228.165378]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
[  228.165378]
[  228.165378]  *** DEADLOCK ***
[  228.165378]
[  228.165378]  May be due to missing lock nesting notation

Signed-off-by: Gustavo Padovan &lt;gustavo.padovan@collabora.co.uk&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Bluetooth: RFCOMM - Fix info leak via getsockname()</title>
<updated>2012-09-19T14:04:52Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2012-08-15T11:31:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=18fc748c13b0a15152bd711c3d42560f833af9e5'/>
<id>urn:sha1:18fc748c13b0a15152bd711c3d42560f833af9e5</id>
<content type='text'>
[ Upstream commit 9344a972961d1a6d2c04d9008b13617bcb6ec2ef ]

The RFCOMM code fails to initialize the trailing padding byte of struct
sockaddr_rc added for alignment. It that for leaks one byte kernel stack
via the getsockname() syscall. Add an explicit memset(0) before filling
the structure to avoid the info leak.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Gustavo Padovan &lt;gustavo@padovan.org&gt;
Cc: Johan Hedberg &lt;johan.hedberg@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Bluetooth: RFCOMM - Fix info leak in ioctl(RFCOMMGETDEVLIST)</title>
<updated>2012-09-19T14:04:52Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2012-08-15T11:31:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2ab341d741cb33f5e69893f6871cf4a4d7bfd3f5'/>
<id>urn:sha1:2ab341d741cb33f5e69893f6871cf4a4d7bfd3f5</id>
<content type='text'>
[ Upstream commit f9432c5ec8b1e9a09b9b0e5569e3c73db8de432a ]

The RFCOMM code fails to initialize the two padding bytes of struct
rfcomm_dev_list_req inserted for alignment before copying it to
userland. Additionally there are two padding bytes in each instance of
struct rfcomm_dev_info. The ioctl() that for disclosures two bytes plus
dev_num times two bytes uninitialized kernel heap memory.

Allocate the memory using kzalloc() to fix this issue.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Gustavo Padovan &lt;gustavo@padovan.org&gt;
Cc: Johan Hedberg &lt;johan.hedberg@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Bluetooth: RFCOMM - Fix info leak in getsockopt(BT_SECURITY)</title>
<updated>2012-09-19T14:04:51Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2012-08-15T11:31:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1621af48f4c2cf3e10438507bea36af7189603b9'/>
<id>urn:sha1:1621af48f4c2cf3e10438507bea36af7189603b9</id>
<content type='text'>
[ Upstream commit 9ad2de43f1aee7e7274a4e0d41465489299e344b ]

The RFCOMM code fails to initialize the key_size member of struct
bt_security before copying it to userland -- that for leaking one
byte kernel stack. Initialize key_size with 0 to avoid the info
leak.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Gustavo Padovan &lt;gustavo@padovan.org&gt;
Cc: Johan Hedberg &lt;johan.hedberg@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Clear RFCOMM session timer when disconnecting last channel</title>
<updated>2011-12-19T00:29:35Z</updated>
<author>
<name>Mat Martineau</name>
<email>mathewm@codeaurora.org</email>
</author>
<published>2011-12-07T00:23:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=79e654787c67f6b05f73366ff8ccac72ba7249e6'/>
<id>urn:sha1:79e654787c67f6b05f73366ff8ccac72ba7249e6</id>
<content type='text'>
When the last RFCOMM data channel is closed, a timer is normally set
up to disconnect the control channel at a later time.  If the control
channel disconnect command is sent with the timer pending, the timer
needs to be cancelled.

If the timer is not cancelled in this situation, the reference
counting logic for the RFCOMM session does not work correctly when the
remote device closes the L2CAP connection.  The session is freed at
the wrong time, leading to a kernel panic.

Signed-off-by: Mat Martineau &lt;mathewm@codeaurora.org&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>Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth</title>
<updated>2011-11-02T19:15:51Z</updated>
<author>
<name>John W. Linville</name>
<email>linville@tuxdriver.com</email>
</author>
<published>2011-11-02T19:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c125d5e846894043361c0c89c1140be8fd6600b7'/>
<id>urn:sha1:c125d5e846894043361c0c89c1140be8fd6600b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'master' of ra.kernel.org:/pub/scm/linux/kernel/git/davem/net</title>
<updated>2011-10-24T22:18:09Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2011-10-24T22:18:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1805b2f04855f07afe3a71d620a68f483b0ed74f'/>
<id>urn:sha1:1805b2f04855f07afe3a71d620a68f483b0ed74f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>bluetooth: Properly clone LSM attributes to newly created child connections</title>
<updated>2011-10-19T03:36:43Z</updated>
<author>
<name>Paul Moore</name>
<email>pmoore@redhat.com</email>
</author>
<published>2011-10-07T09:40:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6230c9b4f8957c8938ee4cf2d03166d3c2dc89de'/>
<id>urn:sha1:6230c9b4f8957c8938ee4cf2d03166d3c2dc89de</id>
<content type='text'>
The Bluetooth stack has internal connection handlers for all of the various
Bluetooth protocols, and unfortunately, they are currently lacking the LSM
hooks found in the core network stack's connection handlers.  I say
unfortunately, because this can cause problems for users who have have an
LSM enabled and are using certain Bluetooth devices.  See one problem
report below:

 * http://bugzilla.redhat.com/show_bug.cgi?id=741703

In order to keep things simple at this point in time, this patch fixes the
problem by cloning the parent socket's LSM attributes to the newly created
child socket.  If we decide we need a more elaborate LSM marking mechanism
for Bluetooth (I somewhat doubt this) we can always revisit this decision
in the future.

Reported-by: James M. Cape &lt;jcape@ignore-your.tv&gt;
Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Bluetooth: rfcomm: Fix sleep in invalid context in rfcomm_security_cfm</title>
<updated>2011-10-14T18:04:54Z</updated>
<author>
<name>Szymon Janc</name>
<email>szymon.janc@tieto.com</email>
</author>
<published>2011-09-26T12:19:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/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: Linearize skbs for use in BNEP, CMTP, HIDP, and RFCOMM</title>
<updated>2011-09-27T21:15:55Z</updated>
<author>
<name>Mat Martineau</name>
<email>mathewm@codeaurora.org</email>
</author>
<published>2011-07-22T21:53:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=449357200c5d73d80a9c42dee5dafed684b3cd17'/>
<id>urn:sha1:449357200c5d73d80a9c42dee5dafed684b3cd17</id>
<content type='text'>
Fragmented skbs are only encountered when receiving ERTM or streaming
mode L2CAP data.  BNEP, CMTP, HIDP, and RFCOMM generally use basic
mode, but they need to handle fragments without crashing.

Signed-off-by: Mat Martineau &lt;mathewm@codeaurora.org&gt;
Signed-off-by: Gustavo F. Padovan &lt;padovan@profusion.mobi&gt;
</content>
</entry>
</feed>
