1. 24 3月, 2014 1 次提交
    • J
      Bluetooth: Fix potential NULL pointer dereference in SMP · 0a66cf20
      Johan Hedberg 提交于
      If a sudden disconnection happens the l2cap_conn pointer may already
      have been cleaned up by the time hci_conn_security gets called,
      resulting in the following oops if we don't have a proper NULL check:
      
      BUG: unable to handle kernel NULL pointer dereference at 000000c8
      IP: [<c132e2ed>] smp_conn_security+0x26/0x151
      *pde = 00000000
      Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      CPU: 1 PID: 673 Comm: memcheck-x86-li Not tainted 3.14.0-rc2+ #437
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      task: f0ef0520 ti: f0d6a000 task.ti: f0d6a000
      EIP: 0060:[<c132e2ed>] EFLAGS: 00010246 CPU: 1
      EIP is at smp_conn_security+0x26/0x151
      EAX: f0ec1770 EBX: f0ec1770 ECX: 00000002 EDX: 00000002
      ESI: 00000002 EDI: 00000000 EBP: f0d6bdc0 ESP: f0d6bda0
       DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
      CR0: 80050033 CR2: 000000c8 CR3: 30f0f000 CR4: 00000690
      Stack:
       f4f55000 00000002 f0d6bdcc c1097a2b c1319f40 f0ec1770 00000002 f0d6bdd0
       f0d6bde8 c1312a82 f0d6bdfc c1312a82 c1319f84 00000008 f4d81c20 f0e5fd86
       f0ec1770 f0d6bdfc f0d6be28 c131be3b c131bdc1 f0d25270 c131be3b 00000008
      Call Trace:
       [<c1097a2b>] ? __kmalloc+0x118/0x128
       [<c1319f40>] ? mgmt_pending_add+0x49/0x9b
       [<c1312a82>] hci_conn_security+0x4a/0x1dd
       [<c1312a82>] ? hci_conn_security+0x4a/0x1dd
       [<c1319f84>] ? mgmt_pending_add+0x8d/0x9b
       [<c131be3b>] pair_device+0x1e1/0x206
       [<c131bdc1>] ? pair_device+0x167/0x206
       [<c131be3b>] ? pair_device+0x1e1/0x206
       [<c131ed44>] mgmt_control+0x275/0x2d6
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0a66cf20
  2. 21 3月, 2014 1 次提交
    • J
      Bluetooth: Fix address value for early disconnection events · 61b1a7fb
      Johan Hedberg 提交于
      We need to ensure that we do not send events to user space with the
      identity address if we have not yet notified user space of the IRK. The
      code was previously trying to handle this for the mgmt_pair_device
      response (which worked well enough) but this is not the only connection
      related event that might be sent to user space before pairing is
      successful: another important event is Device Disconnected.
      
      The issue can actually be solved more simply than the solution
      previously used for mgmt_pair_device. Since we do have the identity
      address tracked as part of the remote IRK struct we can just copy it
      over from there to the hci_conn struct once we've for real sent the mgmt
      event for the new IRK.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      61b1a7fb
  3. 20 3月, 2014 3 次提交
  4. 19 3月, 2014 3 次提交
  5. 15 3月, 2014 1 次提交
  6. 13 3月, 2014 1 次提交
  7. 10 3月, 2014 2 次提交
  8. 01 3月, 2014 2 次提交
  9. 28 2月, 2014 3 次提交
  10. 27 2月, 2014 3 次提交
  11. 26 2月, 2014 1 次提交
    • J
      Bluetooth: Ignore IRKs with no Identity Address · a9a58f86
      Johan Hedberg 提交于
      The Core Specification (4.1) leaves room for sending an SMP Identity
      Address Information PDU with an all-zeros BD_ADDR value. This
      essentially means that we would not have an Identity Address for the
      device and the only means of identifying it would be the IRK value
      itself.
      
      Due to lack of any known implementations behaving like this it's best to
      keep our implementation as simple as possible as far as handling such
      situations is concerned. This patch updates the Identity Address
      Information handler function to simply ignore the IRK received from such
      a device.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a9a58f86
  12. 24 2月, 2014 2 次提交
  13. 23 2月, 2014 2 次提交
  14. 20 2月, 2014 3 次提交
  15. 19 2月, 2014 5 次提交
  16. 18 2月, 2014 5 次提交
  17. 13 2月, 2014 2 次提交
    • J
      Bluetooth: Fix differentiating stored master vs slave LTK types · 98a0b845
      Johan Hedberg 提交于
      If LTK distribution happens in both directions we will have two LTKs for
      the same remote device: one which is used when we're connecting as
      master and another when we're connecting as slave. When looking up LTKs
      from the locally stored list we shouldn't blindly return the first match
      but also consider which type of key is in question. If we do not do this
      we may end up selecting an incorrect encryption key for a connection.
      
      This patch fixes the issue by always specifying to the LTK lookup
      functions whether we're looking for a master or a slave key.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      98a0b845
    • J
      Bluetooth: Enable LTK distribution to slave devices · 0cf73b9f
      Johan Hedberg 提交于
      So far we've only been requesting the LTK to be distributed to the
      master (initiator) of pairing, which is usually enough since it's the
      master that will establish future connections and initiate encryption.
      However, in the case that both devices support switching to the opposing
      role (which seems to be increasingly common) pairing will have to
      performed again since the "new" master will not have all information.
      
      As there is no real harm in it, this patch updates the code to always
      try distributing the LTK also to the slave device, thereby enabling role
      switches for future connections.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NVinicius Gomes <vcgomes@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0cf73b9f