<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/net/bluetooth/smp.c, branch linux-4.16.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.16.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-03-01T18:55:56+00:00</updated>
<entry>
<title>Bluetooth: Fix missing encryption refresh on Security Request</title>
<updated>2018-03-01T18:55:56+00:00</updated>
<author>
<name>Szymon Janc</name>
<email>szymon.janc@codecoup.pl</email>
</author>
<published>2018-02-26T14:41:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=64e759f58f128730b97a3c3a26d283c075ad7c86'/>
<id>urn:sha1:64e759f58f128730b97a3c3a26d283c075ad7c86</id>
<content type='text'>
If Security Request is received on connection that is already encrypted
with sufficient security master should perform encryption key refresh
procedure instead of just ignoring Slave Security Request
(Core Spec 5.0 Vol 3 Part H 2.4.6).

&gt; ACL Data RX: Handle 3585 flags 0x02 dlen 6
      SMP: Security Request (0x0b) len 1
        Authentication requirement: Bonding, No MITM, SC, No Keypresses (0x09)
&lt; HCI Command: LE Start Encryption (0x08|0x0019) plen 28
        Handle: 3585
        Random number: 0x0000000000000000
        Encrypted diversifier: 0x0000
        Long term key: 44264272a5c426a9e868f034cf0e69f3
&gt; HCI Event: Command Status (0x0f) plen 4
      LE Start Encryption (0x08|0x0019) ncmd 1
        Status: Success (0x00)
&gt; HCI Event: Encryption Key Refresh Complete (0x30) plen 3
        Status: Success (0x00)
        Handle: 3585

Signed-off-by: Szymon Janc &lt;szymon.janc@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Use bt_dev_err and bt_dev_info when possible</title>
<updated>2017-10-30T10:25:45+00:00</updated>
<author>
<name>Marcel Holtmann</name>
<email>marcel@holtmann.org</email>
</author>
<published>2017-10-30T09:42:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2064ee332e4c1b7495cf68b84355c213d8fe71fd'/>
<id>urn:sha1:2064ee332e4c1b7495cf68b84355c213d8fe71fd</id>
<content type='text'>
In case of using BT_ERR and BT_INFO, convert to bt_dev_err and
bt_dev_info when possible. This allows for controller specific
reporting.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: let the crypto subsystem generate the ecc privkey</title>
<updated>2017-10-06T18:35:47+00:00</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2017-09-28T14:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c0153b0b901a16663ff91504fea25fb51d57cc29'/>
<id>urn:sha1:c0153b0b901a16663ff91504fea25fb51d57cc29</id>
<content type='text'>
That Bluetooth SMP knows about the private key is pointless, since the
detection of debug key usage is actually via the public key portion.
With this patch, the Bluetooth SMP will stop keeping a copy of the
ecdh private key and will let the crypto subsystem to generate and
handle the ecdh private key, potentially benefiting of hardware
ecc private key generation and retention.

The loop that tries to generate a correct private key is now removed and
we trust the crypto subsystem to generate a correct private key. This
backup logic should be done in crypto, if really needed.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: ecdh_helper - reveal error codes</title>
<updated>2017-10-06T18:35:47+00:00</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2017-09-28T14:14:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a297641610963bbb238ea77b32a2e958c4f7b184'/>
<id>urn:sha1:a297641610963bbb238ea77b32a2e958c4f7b184</id>
<content type='text'>
ecdh_helper functions were hiding the error codes and chose to return
the return value of an relational operator, "==". Remove the unnecessary
query and reveal the error codes.

While updating the return values, code in a way that compilers will
warn in case of uninitialized err.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: move ecdh allocation outside of ecdh_helper</title>
<updated>2017-10-06T18:35:47+00:00</updated>
<author>
<name>Tudor Ambarus</name>
<email>tudor.ambarus@microchip.com</email>
</author>
<published>2017-09-28T14:14:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47eb2ac809189e0a60ad78eec6db9e84004e11be'/>
<id>urn:sha1:47eb2ac809189e0a60ad78eec6db9e84004e11be</id>
<content type='text'>
Before this change, a new crypto tfm was allocated, each time,
for both key generation and shared secret computation.

Allocate a single tfm for both cases.

Signed-off-by: Tudor Ambarus &lt;tudor.ambarus@microchip.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: use constant time memory comparison for secret values</title>
<updated>2017-06-10T13:45:40+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2017-06-10T02:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=329d82309824ff1082dc4a91a5bbed8c3bec1580'/>
<id>urn:sha1:329d82309824ff1082dc4a91a5bbed8c3bec1580</id>
<content type='text'>
This file is filled with complex cryptography. Thus, the comparisons of
MACs and secret keys and curve points and so forth should not add timing
attacks, which could either result in a direct forgery, or, given the
complexity, some other type of attack.

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>Bluetooth: Add selftest for ECDH key generation</title>
<updated>2017-04-30T13:52:43+00:00</updated>
<author>
<name>Marcel Holtmann</name>
<email>marcel@holtmann.org</email>
</author>
<published>2017-04-30T13:51:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=71653eb64bcca6110c42aadfd50b8d54d3a88079'/>
<id>urn:sha1:71653eb64bcca6110c42aadfd50b8d54d3a88079</id>
<content type='text'>
Since the ECDH key generation takes a different path, it needs to be
tested as well. For this generate the public debug key from the private
debug key and compare both.

This also moves the seeding of the private key into the SMP calling code
to allow for easier re-use of the ECDH key generation helper.

Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: convert smp and selftest to crypto kpp API</title>
<updated>2017-04-25T02:53:42+00:00</updated>
<author>
<name>Salvatore Benedetto</name>
<email>salvatore.benedetto@intel.com</email>
</author>
<published>2017-04-24T12:13:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=58771c1cb0023fdd744e76d6cad7716dc4f579ee'/>
<id>urn:sha1:58771c1cb0023fdd744e76d6cad7716dc4f579ee</id>
<content type='text'>
* Convert both smp and selftest to crypto kpp API
* Remove module ecc as no more required
* Add ecdh_helper functions for wrapping kpp async calls

This patch has been tested *only* with selftest, which is called on
module loading.

Signed-off-by: Salvatore Benedetto &lt;salvatore.benedetto@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: SMP: Add support for H7 crypto function and CT2 auth flag</title>
<updated>2016-12-08T06:50:24+00:00</updated>
<author>
<name>Johan Hedberg</name>
<email>johan.hedberg@intel.com</email>
</author>
<published>2016-12-08T06:32:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a62da6f14db79bd7ea435ab095e998b31b3dbb22'/>
<id>urn:sha1:a62da6f14db79bd7ea435ab095e998b31b3dbb22</id>
<content type='text'>
Bluetooth 5.0 introduces a new H7 key generation function that's used
when both sides of the pairing set the CT2 authentication flag to 1.

Signed-off-by: Johan Hedberg &lt;johan.hedberg@intel.com&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Fix not registering BR/EDR SMP channel with force_bredr flag</title>
<updated>2016-09-19T18:19:34+00:00</updated>
<author>
<name>Szymon Janc</name>
<email>szymon.janc@codecoup.pl</email>
</author>
<published>2016-09-09T18:24:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=83ebb9ec734e9e768a9fae469e4a7ed1762ef43a'/>
<id>urn:sha1:83ebb9ec734e9e768a9fae469e4a7ed1762ef43a</id>
<content type='text'>
If force_bredr is set SMP BR/EDR channel should also be for non-SC
capable controllers. Since hcidev flag is persistent wrt power toggle
it can be already set when calling smp_register(). This resulted in
SMP BR/EDR channel not being registered even if HCI_FORCE_BREDR_SMP
flag was set.

This also fix NULL pointer dereference when trying to disable
force_bredr after power cycle.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000388
IP: [&lt;ffffffffc0493ad8&gt;] smp_del_chan+0x18/0x80 [bluetooth]

Call Trace:
[&lt;ffffffffc04950ca&gt;] force_bredr_smp_write+0xba/0x100 [bluetooth]
[&lt;ffffffff8133be14&gt;] full_proxy_write+0x54/0x90
[&lt;ffffffff81245967&gt;] __vfs_write+0x37/0x160
[&lt;ffffffff813617f7&gt;] ? selinux_file_permission+0xd7/0x110
[&lt;ffffffff81356fbd&gt;] ? security_file_permission+0x3d/0xc0
[&lt;ffffffff810eb5b2&gt;] ? percpu_down_read+0x12/0x50
[&lt;ffffffff812462a5&gt;] vfs_write+0xb5/0x1a0
[&lt;ffffffff812476f5&gt;] SyS_write+0x55/0xc0
[&lt;ffffffff817eb872&gt;] entry_SYSCALL_64_fastpath+0x1a/0xa4
Code: 48 8b 45 f0 eb c1 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f
      44 00 00 f6 05 c6 3b 02 00 04 55 48 89 e5 41 54 53 49 89 fc 75
      4b
      &lt;49&gt; 8b 9c 24 88 03 00 00 48 85 db 74 31 49 c7 84 24 88 03 00 00
RIP  [&lt;ffffffffc0493ad8&gt;] smp_del_chan+0x18/0x80 [bluetooth]
RSP &lt;ffff8802aee3bd90&gt;
CR2: 0000000000000388

Signed-off-by: Szymon Janc &lt;szymon.janc@codecoup.pl&gt;
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
</content>
</entry>
</feed>
