<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/bluetooth/af_bluetooth.c, branch linux-2.6.32.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.32.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.32.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-05-19T05:54:00Z</updated>
<entry>
<title>net: rework recvmsg handler msg_name and msg_namelen logic</title>
<updated>2014-05-19T05:54:00Z</updated>
<author>
<name>Hannes Frederic Sowa</name>
</author>
<published>2013-11-21T02:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4485f23cb4c08b21f0a4434a65c8adf0026d589a'/>
<id>urn:sha1:4485f23cb4c08b21f0a4434a65c8adf0026d589a</id>
<content type='text'>
CVE-2013-7266

BugLink: http://bugs.launchpad.net/bugs/1267081

This patch now always passes msg-&gt;msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size &lt;= sizeof(struct sockaddr_storage)
to return msg_name to the user.

This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers and makes it harder for new code to accidentally leak
uninitialized memory.

Optimize for the case recvfrom is called with NULL as address. We don't
need to copy the address at all, so set it to NULL before invoking the
recvmsg handler. We can do so, because all the recvmsg handlers must
cope with the case a plain read() is called on them. read() also sets
msg_name to NULL.

Also document these changes in include/linux/net.h as suggested by David
Miller.

Changes since RFC:

Set msg-&gt;msg_name = NULL if user specified a NULL in msg_name but had a
non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't
affect sendto as it would bail out earlier while trying to copy-in the
address. It also more naturally reflects the logic by the callers of
verify_iovec.

With this change in place I could remove "
if (!uaddr || msg_sys-&gt;msg_namelen == 0)
	msg-&gt;msg_name = NULL
".

This change does not alter the user visible error logic as we ignore
msg_namelen as long as msg_name is NULL.

Also remove two unnecessary curly brackets in ___sys_recvmsg and change
comments to netdev style.

Cc: David Miller &lt;davem@davemloft.net&gt;
Suggested-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Hannes Frederic Sowa &lt;hannes@stressinduktion.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
(back ported from commit f3d3342602f8bcbf37d7c46641cb9bca7618eb1c)
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
Acked-by: Andy Whitcroft &lt;andy.whitcroft@canonical.com&gt;
Acked-by: Stefan Bader &lt;stefan.bader@canonical.com&gt;
Signed-off-by: Tim Gardner &lt;tim.gardner@canonical.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>Bluetooth: fix possible info leak in bt_sock_recvmsg()</title>
<updated>2013-06-10T09:43:00Z</updated>
<author>
<name>Mathias Krause</name>
</author>
<published>2013-04-07T01:51:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e55f3e4377c1908b7ef7b5d42b53c4f646502ce6'/>
<id>urn:sha1:e55f3e4377c1908b7ef7b5d42b53c4f646502ce6</id>
<content type='text'>
commit 4683f42fde3977bdb4e8a09622788cc8b5313778 upstream.

In case the socket is already shutting down, bt_sock_recvmsg() returns
with 0 without updating msg_namelen leading to net/socket.c leaking the
local, uninitialized sockaddr_storage variable to userland -- 128 bytes
of kernel stack memory.

Fix this by moving the msg_namelen assignment in front of the shutdown
test.

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: Mathias Krause &lt;minipli@googlemail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
[dannf: adjusted to apply to Debian's 2.6.32]
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
</content>
</entry>
<entry>
<title>net: mark read-only arrays as const</title>
<updated>2009-08-05T17:42:58Z</updated>
<author>
<name>Jan Engelhardt</name>
</author>
<published>2009-08-05T17:42:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=36cbd3dcc10384f813ec0814255f576c84f2bcd4'/>
<id>urn:sha1:36cbd3dcc10384f813ec0814255f576c84f2bcd4</id>
<content type='text'>
String literals are constant, and usually, we can also tag the array
of pointers const too, moving it to the .rodata section.

Signed-off-by: Jan Engelhardt &lt;jengelh@medozas.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: correct off-by-one write allocations reports</title>
<updated>2009-06-18T07:29:12Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2009-06-18T02:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31e6d363abcd0d05766c82f1a9c905a4c974a199'/>
<id>urn:sha1:31e6d363abcd0d05766c82f1a9c905a4c974a199</id>
<content type='text'>
commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
(net: No more expensive sock_hold()/sock_put() on each tx)
changed initial sk_wmem_alloc value.

We need to take into account this offset when reporting
sk_wmem_alloc to user, in PROC_FS files or various
ioctls (SIOCOUTQ/TIOCOUTQ)

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix poll() misbehavior when using BT_DEFER_SETUP</title>
<updated>2009-02-27T05:14:46Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2009-02-16T01:57:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d5f2d2be68876f65dd051b978a7b66265fde9ffd'/>
<id>urn:sha1:d5f2d2be68876f65dd051b978a7b66265fde9ffd</id>
<content type='text'>
When BT_DEFER_SETUP has been enabled on a Bluetooth socket it keeps
signaling POLLIN all the time. This is a wrong behavior. The POLLIN
should only be signaled if the client socket is in BT_CONNECT2 state
and the parent has been BT_DEFER_SETUP enabled.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Remove CONFIG_DEBUG_LOCK_ALLOC ifdefs</title>
<updated>2009-02-27T05:14:34Z</updated>
<author>
<name>Dave Young</name>
</author>
<published>2009-01-31T05:51:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dd2efd03b49d56ae795c71335bc7358022514c32'/>
<id>urn:sha1:dd2efd03b49d56ae795c71335bc7358022514c32</id>
<content type='text'>
Due to lockdep changes, the CONFIG_DEBUG_LOCK_ALLOC ifdef is not needed
now. So just remove it here.

The following commit fixed the !lockdep build warnings:

commit e8f6fbf62de37cbc2e179176ac7010d5f4396b67
Author: Ingo Molnar &lt;mingo@elte.hu&gt;
Date:   Wed Nov 12 01:38:36 2008 +0000

    lockdep: include/linux/lockdep.h - fix warning in net/bluetooth/af_bluetooth.c

Signed-off-by: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Update version numbers</title>
<updated>2009-02-27T05:14:34Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2009-01-16T09:09:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f9018af004fa8635bbbe3ab2dc61e8a686edfaa'/>
<id>urn:sha1:5f9018af004fa8635bbbe3ab2dc61e8a686edfaa</id>
<content type='text'>
With the support for the enhanced security model and the support for
deferring connection setup, it is a good idea to increase various
version numbers.

This is purely cosmetic and has no effect on the behavior, but can
be really helpful when debugging problems in different kernel versions.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add global deferred socket parameter</title>
<updated>2009-02-27T05:14:23Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2009-01-15T20:52:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c4f912e155504e94dd4f3d63c378dab0ff03dbda'/>
<id>urn:sha1:c4f912e155504e94dd4f3d63c378dab0ff03dbda</id>
<content type='text'>
The L2CAP and RFCOMM applications require support for authorization
and the ability of rejecting incoming connection requests. The socket
interface is not really able to support this.

This patch does the ground work for a socket option to defer connection
setup. Setting this option allows calling of accept() and then the
first read() will trigger the final connection setup. Calling close()
would reject the connection.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Enable per-module dynamic debug messages</title>
<updated>2008-11-30T11:17:28Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2008-11-30T11:17:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a418b893a6af11ae73c762ed5b76c1bad6dc19d8'/>
<id>urn:sha1:a418b893a6af11ae73c762ed5b76c1bad6dc19d8</id>
<content type='text'>
With the introduction of CONFIG_DYNAMIC_PRINTK_DEBUG it is possible to
allow debugging without having to recompile the kernel. This patch turns
all BT_DBG() calls into pr_debug() to support dynamic debug messages.

As a side effect all CONFIG_BT_*_DEBUG statements are now removed and
some broken debug entries have been fixed.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Send HCI Reset command by default on device initialization</title>
<updated>2008-11-30T11:17:26Z</updated>
<author>
<name>Marcel Holtmann</name>
</author>
<published>2008-11-30T11:17:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a9d4020533b5c0c615b6de3be154c9ff30b8cc9'/>
<id>urn:sha1:7a9d4020533b5c0c615b6de3be154c9ff30b8cc9</id>
<content type='text'>
The Bluetooth subsystem was not using the HCI Reset command when doing
device initialization. The Bluetooth 1.0b specification was ambiguous
on how the device firmware was suppose to handle it. Almost every device
was triggering a transport reset at the same time. In case of USB this
ended up in disconnects from the bus.

All modern Bluetooth dongles handle this perfectly fine and a lot of
them actually require that HCI Reset is sent. If not then they are
either stuck in their HID Proxy mode or their internal structures for
inquiry and paging are not correctly setup.

To handle old and new devices smoothly the Bluetooth subsystem contains
a quirk to force the HCI Reset on initialization. However maintaining
such a quirk becomes more and more complicated. This patch turns the
logic around and lets the old devices disable the HCI Reset command.

The only device where the HCI_QUIRK_NO_RESET is still needed are the
original Digianswer devices and dongles with an early CSR firmware.

CSR reported that they fixed this for version 12 firmware. The last
official release of version 11 firmware is build ID 115. The first
version 12 candidate was build ID 117.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
