Skip to content
Snippets Groups Projects
  1. Sep 15, 2017
    • Jack He's avatar
      Clean-up BTIF profile queue on profile shutdown · 997097ea
      Jack He authored
      * Add btif_profile_cleanup(uuid) method to remove pending connection
        requests for individual UUIDs
      * Call the above method in each profile's clean-up method
      * Add unit tests for btif_profile_queue
      
      Bug: 63790458
      Test: make, unit tests, pair and connect car kits
      Change-Id: I28288c295b7ca0259b2112c11b4e5a81d6f2e33c
      997097ea
  2. Sep 14, 2017
  3. Sep 13, 2017
  4. Sep 12, 2017
  5. Sep 11, 2017
    • Jakub Pawlowski's avatar
      Fix alarms being posted on wrong thread · 01a63882
      Jakub Pawlowski authored
      Alarms from btu_bta_alarm_queue and btu_generic_alarm_queue should be
      processed on the main MessageLoop thread.
      Replaced obsoleted alarm_set_on_queue() alarm API with the new
      alarm_set_on_mloop() API
      
      Test: manual
      Bug: 65078753
      Change-Id: I54b472b39b44a6c541dbdcdad7414056d0dd4163
      01a63882
    • Chao Quan's avatar
      Fix crash during derigister GATT server · da483584
      Chao Quan authored
      When deregister a gatt server, GATT_deregister
      will use a loop to stop service one by one and
      call std::list::erase in GATTS_StopService to
      remove service info. But erase makes iterator lose
      efficacy. If the iterator is operated after that,
      Bluetooth will crash.
      
      Add the iterator before erase.
      
      Test: manual
      Change-Id: I10f9351a95ab4922553d8a77663a0212407607aa
      da483584
  6. Sep 08, 2017
    • Jeremy Klein's avatar
      Ensure that services are cleaned from the GattServer HandleMap. · 15f7de8b
      Jeremy Klein authored
      The incorrect service handle was being plumbed up to onServiceDeleted.
      This was causing stale entries to stick around forever in the HandleMap,
      which could later cause failures to find callback references in
      ContextMap if the connection ID changed for a given device.
      
      Bug: 65463237
      Test: unit tests modified and run
      Change-Id: I2e22858b447f4e6b5a4fbceee4c406191c84a67d
      15f7de8b
  7. Sep 07, 2017
  8. Sep 06, 2017
    • Jaekyun Seok's avatar
      Add 'vendor.' prefix to a vendor HAL service name · b926597e
      Jaekyun Seok authored
      To prevent property name collisions between properties of system and
      vendor, 'vendor.' prefix must be added to a vendor HAL service name.
      You can see the details in http://go/treble-sysprop-compatibility.
      
      Test: succeeded building gce_x86_phone-userdebug and confirmed that
      service names were renamed correctly.
      Bug: 36796459
      Change-Id: Iedcb3a01e00e80c58dc76653784a3c353f34ce0a
      b926597e
    • Michael Spang's avatar
      Fix stack-buffer-overflow in bluetooth service GATT client · b49ba108
      Michael Spang authored
      Use the tBTA_GATTC union for |notify| in bta_gattc_process_indicate() to
      avoid a stack-buffer-overflow in btif_transfer_context.
      
      ==1410==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x0077c8c0c066 at pc 0x0077e50c9ae0 bp 0x0077c8c0bcd0 sp 0x0077c8c0b460
      
      READ of size 616 at 0x0077c8c0c066 thread T38 (btu message loo)
          #0 0x77e50c9adf in __interceptor_memcpy external/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:701:5
          #1 0x77ca1e838f in memcpy(void*, void const* pass_object_size0, unsigned long) bionic/libc/include/string.h:173:12
          #2 0x77ca1e838f in btif_transfer_context(void (*)(unsigned short, char*), unsigned short, char*, int, void (*)(unsigned short, char*, char*)) system/bt/btif/src/btif_core.cc:208:0
          #3 0x77ca209853 in (anonymous namespace)::bta_gattc_cback(unsigned char, tBTA_GATTC*) system/bt/btif/src/btif_gatt_client.cc:204:7
          #4 0x77ca11455b in bta_gattc_process_indicate(unsigned short, unsigned char, tGATT_CL_COMPLETE*) system/bt/bta/gatt/bta_gattc_act.cc:1596:9
          #5 0x77ca40b4b7 in gatt_process_notification(tGATT_TCB&, unsigned char, unsigned short, unsigned char*) system/bt/stack/gatt/gatt_cl.cc:664:7
          #6 0x77ca40d78f in gatt_client_handle_server_rsp(tGATT_TCB&, unsigned char, unsigned short, unsigned char*) system/bt/stack/gatt/gatt_cl.cc:1119:9
          #7 0x77ca414447 in gatt_le_data_ind(unsigned short, unsigned char*, BT_HDR*) system/bt/stack/gatt/gatt_main.cc:576:7
          #8 0x77ca47665b in l2c_rcv_acl_data(BT_HDR*) system/bt/stack/l2cap/l2c_main.cc:211:9
          #9 0x77c9da50eb in base::Callback<void (), (base::internal::CopyMode)1>::Run() const external/libchrome/base/callback.h:389:12
          #10 0x77c9da50eb in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) external/libchrome/base/debug/task_annotator.cc:51:0
          #11 0x77c9df75e3 in base::MessageLoop::RunTask(base::PendingTask const&) external/libchrome/base/message_loop/message_loop.cc:494:19
          #12 0x77c9df80b7 in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask) external/libchrome/base/message_loop/message_loop.cc:503:5
          #13 0x77c9df8fb7 in base::MessageLoop::DoWork() external/libchrome/base/message_loop/message_loop.cc:627:13
          #14 0x77c9dfd33b in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) external/libchrome/base/message_loop/message_pump_default.cc:35:31
          #15 0x77c9e4e327 in base::RunLoop::Run() external/libchrome/base/run_loop.cc:35:10
          #16 0x77ca3e97ab in btu_message_loop_run(void*) system/bt/stack/btu/btu_task.cc:98:14
          #17 0x77ca52ad3b in work_queue_read_cb(void*) system/bt/osi/src/thread.cc:251:3
          #18 0x77ca52489b in run_reactor(reactor_t*, int) system/bt/osi/src/reactor.cc:282:11
          #19 0x77ca524413 in reactor_start(reactor_t*) system/bt/osi/src/reactor.cc:125:10
          #20 0x77ca529c6f in run_thread(void*) system/bt/osi/src/thread.cc:221:3
          #21 0x77eb40a31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18
          #22 0x77eb3c1dff in __start_thread bionic/libc/bionic/clone.cpp:47:16
      
      002(bluetooth) btu message loo identical 2 lines
      
      Address 0x0077c8c0c066 is located in stack of thread T38 (btu message loo)
       at offset 646 in frame
      
          #0 0x77ca114293 in bta_gattc_process_indicate(unsigned short, unsigned char, tGATT_CL_COMPLETE*) system/bt/bta/gatt/bta_gattc_act.cc:1538:0
      
      002(bluetooth) btu message loo identical 1 line
      
        This frame has 4 object(s):
      
          [32, 646) 'notify' (line 1543)
          [784, 790) 'remote_bda' (line 1544) <== Memory access at offset 646 partially underflows this variable
          [816, 817) 'gatt_if' (line 1545) <== Memory access at offset 646 partially underflows this variable
          [832, 833) 'transport' (line 1546) <== Memory access at offset 646 partially underflows this variable
      
      HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      
            (longjmp and C++ exceptions *are* supported)
      
      Thread T38 (btu message loo) created by T37 (bt_workqueue) here:
      
          #0 0x77e50fd46f in __interceptor_pthread_create _asan_rtl_:3
          #1 0x77ca529727 in thread_new_sized(char const*, unsigned long) system/bt/osi/src/thread.cc:87:3
          #2 0x77ca3e9a73 in btu_task_start_up(void*) system/bt/stack/btu/btu_task.cc:127:26
          #3 0x77ca52ad3b in work_queue_read_cb(void*) system/bt/osi/src/thread.cc:251:3
          #4 0x77ca52489b in run_reactor(reactor_t*, int) system/bt/osi/src/reactor.cc:282:11
          #5 0x77ca524413 in reactor_start(reactor_t*) system/bt/osi/src/reactor.cc:125:10
          #6 0x77ca529c6f in run_thread(void*) system/bt/osi/src/thread.cc:221:3
          #7 0x77eb40a31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18
          #8 0x77eb3c1dff in __start_thread bionic/libc/bionic/clone.cpp:47:16
      
      002(bluetooth) btu message loo identical 1 line
      
      Thread T37 (bt_workqueue) created by T20 (stack_manager) here:
      
          #0 0x77e50fd46f in __interceptor_pthread_create _asan_rtl_:3
          #1 0x77ca529727 in thread_new_sized(char const*, unsigned long) system/bt/osi/src/thread.cc:87:3
          #2 0x77ca3e936f in BTU_StartUp() system/bt/stack/btu/btu_init.cc:129:25
          #3 0x77ca2a513b in event_start_up_stack(void*) system/bt/btif/src/stack_manager.cc:146:3
          #4 0x77ca52ad3b in work_queue_read_cb(void*) system/bt/osi/src/thread.cc:251:3
          #5 0x77ca52489b in run_reactor(reactor_t*, int) system/bt/osi/src/reactor.cc:282:11
          #6 0x77ca524413 in reactor_start(reactor_t*) system/bt/osi/src/reactor.cc:125:10
          #7 0x77ca529c6f in run_thread(void*) system/bt/osi/src/thread.cc:221:3
          #8 0x77eb40a31b in __pthread_start(void*) bionic/libc/bionic/pthread_create.cpp:214:18
          #9 0x77eb3c1dff in __start_thread bionic/libc/bionic/clone.cpp:47:16
      
      002(bluetooth) btu message loo identical 1 line
      
      Thread T20 (stack_manager) created by T0 (droid.bluetooth) here:
      
          #0 0x77e50fd46f in __interceptor_pthread_create _asan_rtl_:3
          #1 0x77ca529727 in thread_new_sized(char const*, unsigned long) system/bt/osi/src/thread.cc:87:3
          #2 0x77ca2a4e7f in ensure_manager_initialized() system/bt/btif/src/stack_manager.cc:238:23
          #3 0x77ca2a4e7f in stack_manager_get_interface() system/bt/btif/src/stack_manager.cc:251:0
          #4 0x77ca1b7927 in init(bt_callbacks_t*) system/bt/btif/src/bluetooth.cc:144:3
          #5 0x77ca9899fb in android::initNative(_JNIEnv*, _jobject*) packages/apps/Bluetooth/jni/com_android_bluetooth_btservice_AdapterService.cpp:663:13
          #6 0x77e1c87703 in art_quick_generic_jni_trampoline /proc/self/cwd/art/runtime/arch/arm64/quick_entrypoints_arm64.S:2329:0
      
          #6 0x37ab0579318381f  (<unknown module>)
      
      002(bluetooth) btu message loo identical 1 line
      
      SUMMARY: AddressSanitizer: stack-buffer-overflow (/system/lib64/libclang_rt.asan-aarch64-android.so+0x31adf)
      
      Shadow bytes around the buggy address:
        0x001ef91817b0: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
        0x001ef91817c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef91817d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef91817e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef91817f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      =>0x001ef9181800: 00 00 00 00 00 00 00 00 00 00 00 00[06]f2 f2 f2
        0x001ef9181810: f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 f2 06 f2
        0x001ef9181820: f2 f2 01 f2 01 f3 f3 f3 00 00 00 00 00 00 00 00
        0x001ef9181830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef9181840: f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 00 00
        0x001ef9181850: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      
      ==1410==ABORTING
      
      Bug: 65381426
      
      Change-Id: Ie632f131b622cc323ce68ec7be152caef23c95ec
      b49ba108
    • Treehugger Robot's avatar
    • Jakub Pawlowski's avatar
      Fix GATT log spam · 45c3106e
      Jakub Pawlowski authored
      Bug: 65255942
      Test: manual
      Change-Id: I212bc93149dc514517f409edc36f74e1c2895d96
      45c3106e
    • Pavlin Radoslavov's avatar
      Store a name string in property without violating string boundaries · 3b3c6d1a
      Pavlin Radoslavov authored
      Don't copy data beyond end of string when storing it as BT_PROPERTY_BDNAME
      in property.
      Also, update an unit test to create a string by considering the property
      name length.
      
      Test: Running unit tests with ASAN enabled
      Change-Id: Iaa586b4a0942f99ba469d1ed963729e7ad721503
      3b3c6d1a
    • Sagayajayasheelan Thomas's avatar
      Extended Scan HCI definations as per BT 5.0 SIG · 483e7b33
      Sagayajayasheelan Thomas authored
      
      Added Ext Scan HCI defination for periodic scan.
      
      Change-Id: Ic7dce5fb5207a22e4b193d84033d84126d780be5
      Signed-off-by: default avatarSagayajayasheelan Thomas <sagayajayasheelan.thomas@intel.com>
      483e7b33
    • Srinu Jella's avatar
      Clear IB_CFG_DONE on receiving peer config request when channel open · bb77f6a0
      Srinu Jella authored
      Root Cause: Configure request fails in CST_OPEN state
      after a configure request IB_CFG_DONE and OB_CFG_DONE both are
      cleared. Some IOT devices try to configure again in the CST_OPEN
      state which fails if OB_CFG_DONE is cleared.
      
      Fix: Clear IB_CFG_DONE and keep OB_CFG_DONE unchanged on receiving
      Peer config request when channel open.
      
      Test: Tested with Geely Carkit.
      Bug: 35082459
      
      Change-Id: I8deca0c8ff73faafc3da94dcd9ea55e06bd8a31d
      bb77f6a0
  9. Sep 05, 2017
  10. Sep 01, 2017
  11. Aug 31, 2017
  12. Aug 30, 2017
  13. Aug 25, 2017
  14. Aug 22, 2017
    • Jakub Pawlowski's avatar
      Fix crashes in btm_consolidate_dev · 8ec8b8c3
      Jakub Pawlowski authored
      It is not safe to do list_next after list_remove.
      
      Test: sl4a BleStressTest:test_le_pairing
      Bug: 31442085
      Change-Id: Ib4cb02154684b39ebc652d20559e1b07eee2c357
      8ec8b8c3
  15. Aug 18, 2017
  16. Aug 17, 2017
Loading