1. 11 9月, 2020 1 次提交
    • D
      Bluetooth: Add MGMT capability flags for tx power and ext advertising · d5ea32da
      Daniel Winkler 提交于
      For new advertising features, it will be important for userspace to
      know the capabilities of the controller and kernel. If the controller
      and kernel support extended advertising, we include flags indicating
      hardware offloading support and support for setting tx power of adv
      instances.
      
      In the future, vendor-specific commands may allow the setting of tx
      power in advertising instances, but for now this feature is only
      marked available if extended advertising is supported.
      
      This change is manually verified in userspace by ensuring the
      advertising manager's supported_flags field is updated with new flags on
      hatch chromebook (ext advertising supported).
      Signed-off-by: NDaniel Winkler <danielwinkler@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d5ea32da
  2. 30 7月, 2020 4 次提交
  3. 28 7月, 2020 1 次提交
  4. 16 7月, 2020 1 次提交
    • P
      Bluetooth: Fix update of connection state in `hci_encrypt_cfm` · 339ddaa6
      Patrick Steinhardt 提交于
      Starting with the upgrade to v5.8-rc3, I've noticed I wasn't able to
      connect to my Bluetooth headset properly anymore. While connecting to
      the device would eventually succeed, bluetoothd seemed to be confused
      about the current connection state where the state was flapping hence
      and forth. Bisecting this issue led to commit 3ca44c16 (Bluetooth:
      Consolidate encryption handling in hci_encrypt_cfm, 2020-05-19), which
      refactored `hci_encrypt_cfm` to also handle updating the connection
      state.
      
      The commit in question changed the code to call `hci_connect_cfm` inside
      `hci_encrypt_cfm` and to change the connection state. But with the
      conversion, we now only update the connection state if a status was set
      already. In fact, the reverse should be true: the status should be
      updated if no status is yet set. So let's fix the isuse by reversing the
      condition.
      
      Fixes: 3ca44c16 ("Bluetooth: Consolidate encryption handling in hci_encrypt_cfm")
      Signed-off-by: NPatrick Steinhardt <ps@pks.im>
      Acked-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      339ddaa6
  5. 07 7月, 2020 1 次提交
  6. 23 6月, 2020 1 次提交
    • L
      Bluetooth: Disconnect if E0 is used for Level 4 · 8746f135
      Luiz Augusto von Dentz 提交于
      E0 is not allowed with Level 4:
      
      BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C page 1319:
      
        '128-bit equivalent strength for link and encryption keys
         required using FIPS approved algorithms (E0 not allowed,
         SAFER+ not allowed, and P-192 not allowed; encryption key
         not shortened'
      
      SC enabled:
      
      > HCI Event: Read Remote Extended Features (0x23) plen 13
              Status: Success (0x00)
              Handle: 256
              Page: 1/2
              Features: 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                Secure Simple Pairing (Host Support)
                LE Supported (Host)
                Secure Connections (Host Support)
      > HCI Event: Encryption Change (0x08) plen 4
              Status: Success (0x00)
              Handle: 256
              Encryption: Enabled with AES-CCM (0x02)
      
      SC disabled:
      
      > HCI Event: Read Remote Extended Features (0x23) plen 13
              Status: Success (0x00)
              Handle: 256
              Page: 1/2
              Features: 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                Secure Simple Pairing (Host Support)
                LE Supported (Host)
      > HCI Event: Encryption Change (0x08) plen 4
              Status: Success (0x00)
              Handle: 256
              Encryption: Enabled with E0 (0x01)
      [May 8 20:23] Bluetooth: hci0: Invalid security: expect AES but E0 was used
      < HCI Command: Disconnect (0x01|0x0006) plen 3
              Handle: 256
              Reason: Authentication Failure (0x05)
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      8746f135
  7. 22 6月, 2020 1 次提交
  8. 18 6月, 2020 10 次提交
  9. 12 6月, 2020 4 次提交
  10. 20 5月, 2020 1 次提交
  11. 18 5月, 2020 1 次提交
    • G
      Bluetooth: L2CAP: Replace zero-length array with flexible-array · 631512f8
      Gustavo A. R. Silva 提交于
      The current codebase makes use of the zero-length array language
      extension to the C90 standard, but the preferred mechanism to declare
      variable-length types such as these ones is a flexible array member[1][2],
      introduced in C99:
      
      struct foo {
              int stuff;
              struct boo array[];
      };
      
      By making use of the mechanism above, we will get a compiler warning
      in case the flexible array does not occur last in the structure, which
      will help us prevent some kind of undefined behavior bugs from being
      inadvertently introduced[3] to the codebase from now on.
      
      Also, notice that, dynamic memory allocations won't be affected by
      this change:
      
      "Flexible array members have incomplete type, and so the sizeof operator
      may not be applied. As a quirk of the original implementation of
      zero-length arrays, sizeof evaluates to zero."[1]
      
      sizeof(flexible-array-member) triggers a warning because flexible array
      members have incomplete type[1]. There are some instances of code in
      which the sizeof operator is being incorrectly/erroneously applied to
      zero-length arrays and the result is zero. Such instances may be hiding
      some bugs. So, this work (flexible-array member conversions) will also
      help to get completely rid of those sorts of issues.
      
      This issue was found with the help of Coccinelle.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
      [2] https://github.com/KSPP/linux/issues/21
      [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour")
      Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      631512f8
  12. 13 5月, 2020 2 次提交
  13. 11 5月, 2020 4 次提交
  14. 28 4月, 2020 1 次提交
    • A
      Bluetooth: Adding driver and quirk defs for multi-role LE · 22091585
      Alain Michaud 提交于
      This change adds the relevant driver and quirk to allow drivers to
      report the le_states as being trustworthy.
      
      This has historically been disabled as controllers did not reliably
      support this. In particular, this will be used to relax this condition
      for controllers that have been well tested and reliable.
      
      	/* Most controller will fail if we try to create new connections
      	 * while we have an existing one in slave role.
      	 */
      	if (hdev->conn_hash.le_num_slave > 0)
      		return NULL;
      Signed-off-by: NAlain Michaud <alainm@chromium.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      22091585
  15. 15 4月, 2020 3 次提交
  16. 08 4月, 2020 1 次提交
  17. 05 4月, 2020 3 次提交