1. 30 12月, 2014 8 次提交
  2. 27 12月, 2014 1 次提交
  3. 25 12月, 2014 2 次提交
    • J
      Bluetooth: Fix accepting connections when not using mgmt · 6a8fc95c
      Johan Hedberg 提交于
      When connectable mode is enabled (page scan on) through some non-mgmt
      method the HCI_CONNECTABLE flag will not be set. For backwards
      compatibility with user space versions not using mgmt we should not
      require HCI_CONNECTABLE to be set if HCI_MGMT is not set.
      Reported-by: NPali Rohár <pali.rohar@gmail.com>
      Tested-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org # 3.17+
      6a8fc95c
    • M
      Bluetooth: Fix controller configuration with HCI_QUIRK_INVALID_BDADDR · 8bfe8442
      Marcel Holtmann 提交于
      When controllers set the HCI_QUIRK_INVALID_BDADDR flag, it is required
      by userspace to program a valid public Bluetooth device address into
      the controller before it can be used.
      
      After successful address configuration, the internal state changes and
      the controller runs the complete initialization procedure. However one
      small difference is that this is no longer the HCI_SETUP stage. The
      HCI_SETUP stage is only valid during initial controller setup. In this
      case the stack runs the initialization as part of the HCI_CONFIG stage.
      
      The controller version information, default name and supported commands
      are only stored during HCI_SETUP. While these information are static,
      they are not read initially when HCI_QUIRK_INVALID_BDADDR is set. So
      when running in HCI_CONFIG state, these information need to be updated
      as well.
      
      This especially impacts Bluetooth 4.1 and later controllers using
      extended feature pages and second event mask page.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org # 3.17+
      8bfe8442
  4. 21 12月, 2014 2 次提交
  5. 20 12月, 2014 12 次提交
  6. 19 12月, 2014 6 次提交
  7. 18 12月, 2014 1 次提交
    • M
      Bluetooth: Fix bug with filter in service discovery optimization · ea8ae251
      Marcel Holtmann 提交于
      The optimization for filtering out extended inquiry results, advertising
      reports or scan response data based on provided UUID list has a logic
      bug. In case no match is found in the advertising data, the scan
      response is ignored and not checked against the filter. This will lead
      to events being filtered wrongly.
      
      Change the code to actually only drop the events when the scan response
      data is not present. If it is present, it needs to be checked against
      the provided filter.
      
      The patch is a bit more complex than it needs to be. That is because
      it also fixes this compiler warning that some gcc versions produce.
      
        CC      net/bluetooth/mgmt.o
      net/bluetooth/mgmt.c: In function ‘mgmt_device_found’:
      net/bluetooth/mgmt.c:7028:7: warning: ‘match’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        bool match;
             ^
      
      It seems that gcc can not clearly figure out the context of the match
      variable. So just change the branches for the extended inquiry response
      and advertising data around so that it is clear.
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      ea8ae251
  8. 12 12月, 2014 6 次提交
  9. 11 12月, 2014 2 次提交
    • J
      Bluetooth: Fix missing hci_dev_lock/unlock in hci_event · 5c1a4c8f
      Jaganath Kanakkassery 提交于
      mgmt_pending_remove() should be called with hci_dev_lock protection and
      all hci_event.c functions which calls mgmt_complete() (which eventually
      calls mgmt_pending_remove()) should hold the lock.
      So this patch fixes the same
      Signed-off-by: NJaganath Kanakkassery <jaganath.k@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      5c1a4c8f
    • J
      Bluetooth: Fix missing hci_dev_lock/unlock in mgmt req_complete() · 3ad67582
      Jaganath Kanakkassery 提交于
      mgmt_pending_remove() should be called with hci_dev_lock protection
      and currently the rule to take dev lock is that all mgmt req_complete
      functions should take dev lock. So this patch fixes the same in the
      missing functions
      
      Without this patch there is a chance of invalid memory access while
      accessing the mgmt_pending list like below
      
      bluetoothd:  392] [0] Backtrace:
      bluetoothd:  392] [0] [<c04ec770>] (pending_eir_or_class+0x0/0x68) from [<c04f1830>] (add_uuid+0x34/0x1c4)
      bluetoothd:  392] [0] [<c04f17fc>] (add_uuid+0x0/0x1c4) from [<c04f3cc4>] (mgmt_control+0x204/0x274)
      bluetoothd:  392] [0] [<c04f3ac0>] (mgmt_control+0x0/0x274) from [<c04f609c>] (hci_sock_sendmsg+0x80/0x308)
      bluetoothd:  392] [0] [<c04f601c>] (hci_sock_sendmsg+0x0/0x308) from [<c03d4d68>] (sock_aio_write+0x144/0x174)
      bluetoothd:  392] [0]  r8:00000000 r7 7c1be90 r6 7c1be18 r5:00000017 r4 a90ea80
      bluetoothd:  392] [0] [<c03d4c24>] (sock_aio_write+0x0/0x174) from [<c00e2d4c>] (do_sync_write+0xb0/0xe0)
      bluetoothd:  392] [0] [<c00e2c9c>] (do_sync_write+0x0/0xe0) from [<c00e371c>] (vfs_write+0x134/0x13c)
      bluetoothd:  392] [0]  r8:00000000 r7 7c1bf70 r6:beeca5c8 r5:00000017 r4 7c05900
      bluetoothd:  392] [0] [<c00e35e8>] (vfs_write+0x0/0x13c) from [<c00e3910>] (sys_write+0x44/0x70)
      bluetoothd:  392] [0]  r8:00000000 r7:00000004 r6:00000017 r5:beeca5c8 r4 7c05900
      bluetoothd:  392] [0] [<c00e38cc>] (sys_write+0x0/0x70) from [<c000e3c0>] (ret_fast_syscall+0x0/0x30)
      bluetoothd:  392] [0]  r9 7c1a000d r8:c000e568 r6:400b5f10 r5:403896d8 r4:beeca604
      bluetoothd:  392] [0] Code: e28cc00c e152000c 0a00000f e3a00001 (e1d210b8)
      bluetoothd:  392] [0] ---[ end trace 67b6ac67435864c4 ]---
      bluetoothd:  392] [0] Kernel panic - not syncing: Fatal exception
      Signed-off-by: NJaganath Kanakkassery <jaganath.k@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      3ad67582