1. 02 6月, 2014 2 次提交
    • J
      Bluetooth: Fix L2CAP deadlock · 8a96f3cd
      Jukka Taimisto 提交于
      -[0x01 Introduction
      
      We have found a programming error causing a deadlock in Bluetooth subsystem
      of Linux kernel. The problem is caused by missing release_sock() call when
      L2CAP connection creation fails due full accept queue.
      
      The issue can be reproduced with 3.15-rc5 kernel and is also present in
      earlier kernels.
      
      -[0x02 Details
      
      The problem occurs when multiple L2CAP connections are created to a PSM which
      contains listening socket (like SDP) and left pending, for example,
      configuration (the underlying ACL link is not disconnected between
      connections).
      
      When L2CAP connection request is received and listening socket is found the
      l2cap_sock_new_connection_cb() function (net/bluetooth/l2cap_sock.c) is called.
      This function locks the 'parent' socket and then checks if the accept queue
      is full.
      
      1178         lock_sock(parent);
      1179
      1180         /* Check for backlog size */
      1181         if (sk_acceptq_is_full(parent)) {
      1182                 BT_DBG("backlog full %d", parent->sk_ack_backlog);
      1183                 return NULL;
      1184         }
      
      If case the accept queue is full NULL is returned, but the 'parent' socket
      is not released. Thus when next L2CAP connection request is received the code
      blocks on lock_sock() since the parent is still locked.
      
      Also note that for connections already established and waiting for
      configuration to complete a timeout will occur and l2cap_chan_timeout()
      (net/bluetooth/l2cap_core.c) will be called. All threads calling this
      function will also be blocked waiting for the channel mutex since the thread
      which is waiting on lock_sock() alread holds the channel mutex.
      
      We were able to reproduce this by sending continuously L2CAP connection
      request followed by disconnection request containing invalid CID. This left
      the created connections pending configuration.
      
      After the deadlock occurs it is impossible to kill bluetoothd, btmon will not
      get any more data etc. requiring reboot to recover.
      
      -[0x03 Fix
      
      Releasing the 'parent' socket when l2cap_sock_new_connection_cb() returns NULL
      seems to fix the issue.
      Signed-off-by: NJukka Taimisto <jtt@codenomicon.com>
      Reported-by: NTommi Mäkilä <tmakila@codenomicon.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org
      8a96f3cd
    • J
      Bluetooth: Fix missing check for FIPS security level · f3fb0b58
      Johan Hedberg 提交于
      When checking whether a legacy link key provides at least HIGH security
      level we also need to check for FIPS level which is one step above HIGH.
      This patch fixes a missing check in the hci_link_key_request_evt()
      function.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      f3fb0b58
  2. 01 6月, 2014 1 次提交
  3. 31 5月, 2014 4 次提交
  4. 27 5月, 2014 1 次提交
  5. 24 5月, 2014 1 次提交
  6. 20 5月, 2014 6 次提交
  7. 16 5月, 2014 6 次提交
  8. 10 5月, 2014 1 次提交
  9. 09 5月, 2014 2 次提交
    • M
      Bluetooth: Increment management interface revision · b75cf9cd
      Marcel Holtmann 提交于
      This patch increments the management interface revision due to the
      changes with the Device Found management event and other fixes.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      b75cf9cd
    • P
      Bluetooth: btusb: Add Broadcom patch RAM support · 10d4c673
      Petri Gynther 提交于
      After hardware reset, some BCM Bluetooth adapters obtain their initial firmware
      from OTPROM chip. Once this initial firmware is running, the firmware can be
      further upgraded over HCI interface with .hcd files provided by Broadcom. This
      is also known as "patch RAM" support. This change implements that.
      
      If the .hcd file is not found in /lib/firmware, BCM Bluetooth adapter continues
      to operate with the initial firmware. Sample kernel log:
        hotplug: sys=firmware act=add fw=brcm/BCM20702A0-0a5c-22be.hcd dev=...
        Bluetooth: hci0: BCM: patch brcm/BCM20702A0-0a5c-22be.hcd not found
      
      If the .hcd file is found, btusb driver pushes it to the BCM Bluetooth adapter and
      it starts using the new firmware. Sample kernel log:
        hotplug: sys=firmware act=add fw=brcm/BCM20702A0-0a5c-22be.hcd dev=...
        Bluetooth: hci0: BCM: patching hci_ver=06 hci_rev=1000 lmp_ver=06 lmp_subver=220e
        Bluetooth: hci0: BCM: firmware hci_ver=06 hci_rev=1389 lmp_ver=06 lmp_subver=220e
      
      Above, we can see that hci_rev goes from 1000 to 1389 as a result of the upgrade.
      Signed-off-by: NPetri Gynther <pgynther@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      10d4c673
  10. 08 5月, 2014 2 次提交
  11. 06 5月, 2014 1 次提交
  12. 24 4月, 2014 3 次提交
  13. 12 4月, 2014 4 次提交
    • M
      Bluetooth: Request MITM Protection when initiator · b16c6604
      Mikel Astiz 提交于
      The GAP Specification gives the flexibility to decide whether MITM
      Protection is requested or not (Bluetooth Core Specification v4.0
      Volume 3, part C, section 6.5.3) when replying to an
      HCI_EV_IO_CAPA_REQUEST event.
      
      The recommendation is *not* to set this flag "unless the security
      policy of an available local service requires MITM Protection"
      (regardless of the bonding type). However, the kernel doesn't
      necessarily have this information and therefore the safest choice is
      to always use MITM Protection, also for General Bonding.
      
      This patch changes the behavior for the General Bonding initiator
      role, always requesting MITM Protection even if no high security level
      is used. Depending on the remote capabilities, the protection might
      not be actually used, and we will accept this locally unless of course
      a high security level was originally required.
      
      Note that this was already done for Dedicated Bonding. No-Bonding is
      left unmodified because MITM Protection is normally not desired in
      these cases.
      Signed-off-by: NMikel Astiz <mikel.astiz@bmw-carit.de>
      Signed-off-by: NTimo Mueller <timo.mueller@bmw-carit.de>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      b16c6604
    • T
      Bluetooth: Use MITM Protection when IO caps allow it · 7e74170a
      Timo Mueller 提交于
      When responding to a remotely-initiated pairing procedure, a MITM
      protected SSP associaton model can be used for pairing if both local
      and remote IO capabilities are set to something other than
      NoInputNoOutput, regardless of the bonding type (Dedicated or
      General).
      
      This was already done for Dedicated Bonding but this patch proposes to
      use the same policy for General Bonding as well.
      
      The GAP Specification gives the flexibility to decide whether MITM
      Protection is used ot not (Bluetooth Core Specification v4.0 Volume 3,
      part C, section 6.5.3).
      
      Note however that the recommendation is *not* to set this flag "unless
      the security policy of an available local service requires MITM
      Protection" (for both Dedicated and General Bonding). However, as we are
      already requiring MITM for Dedicated Bonding, we will follow this
      behaviour also for General Bonding.
      Signed-off-by: NTimo Mueller <timo.mueller@bmw-carit.de>
      Signed-off-by: NMikel Astiz <mikel.astiz@bmw-carit.de>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      7e74170a
    • M
      Bluetooth: Refactor code for outgoing dedicated bonding · 6fd6b915
      Mikel Astiz 提交于
      Do not always set the MITM protection requirement by default in the
      field conn->auth_type, since this will be added later in
      hci_io_capa_request_evt(), as part of the requirements specified in
      HCI_OP_IO_CAPABILITY_REPLY.
      
      This avoids a hackish exception for the auto-reject case, but doesn't
      change the behavior of the code at all.
      Signed-off-by: NMikel Astiz <mikel.astiz@bmw-carit.de>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      6fd6b915
    • M
      Bluetooth: Refactor hci_get_auth_req() · b7f94c88
      Mikel Astiz 提交于
      Refactor the code without changing its behavior by handling the
      no-bonding cases first followed by General Bonding.
      Signed-off-by: NMikel Astiz <mikel.astiz@bmw-carit.de>
      Signed-off-by: NTimo Mueller <timo.mueller@bmw-carit.de>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      b7f94c88
  14. 29 3月, 2014 2 次提交
  15. 28 3月, 2014 4 次提交