Skip to content
Snippets Groups Projects
  1. Oct 14, 2024
    • Brian Delwiche's avatar
      Fix OOB writes in gatt_sr.cc · c7468e64
      Brian Delwiche authored
      At various points in gatt_sr.cc, the output of the
      gatt_tcb_get_payload_size function is used without checking for a
      positive length.  However, in exceptional cases it is possible for the
      channel to be closed at the time the function is called, which will lead
      to a zero length and cause an OOB write in subsequent processing.
      
      Fix all of these.
      
      Bug: 364026473
      Bug: 364027038
      Bug: 364027949
      Bug: 364025411
      Test: m libbluetooth
      Test: researcher POC
      Flag: EXEMPT trivial validity checks
      Tag: #security
      Ignore-AOSP-First: Security
      (cherry picked from commit 7de5617f)
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:130861eadc3d9eda593df949666e561dd1f020fc)
      Merged-In: I9b30499d4aed6ab42f3cdb2c0de7df2c1a827404
      Change-Id: I9b30499d4aed6ab42f3cdb2c0de7df2c1a827404
      c7468e64
  2. Oct 09, 2024
  3. Aug 22, 2023
  4. May 16, 2023
    • Brian Delwiche's avatar
      Fix integer overflow in build_read_multi_rsp · badb8ffc
      Brian Delwiche authored
      Local variables tracking structure size in build_read_multi_rsp are of
      uint16 type but accept a full uint16 range from function arguments while
      appending a fixed-length offset.  This can lead to an integer overflow
      and unexpected behavior.
      
      Change the locals to size_t, and add a check during reasssignment.
      
      Bug: 273966636
      Test: atest bluetooth_test_gd_unit, net_test_stack_btm
      Tag: #security
      Ignore-AOSP-First: Security
      Change-Id: I3a74bdb0d003cb6bf4f282615be8c68836676715
      (cherry picked from commit 70a4d628)
      badb8ffc
  5. Apr 26, 2023
    • Brian Delwiche's avatar
      Fix integer overflow in build_read_multi_rsp · 70a4d628
      Brian Delwiche authored
      Local variables tracking structure size in build_read_multi_rsp are of
      uint16 type but accept a full uint16 range from function arguments while
      appending a fixed-length offset.  This can lead to an integer overflow
      and unexpected behavior.
      
      Change the locals to size_t, and add a check during reasssignment.
      
      Bug: 273966636
      Test: atest bluetooth_test_gd_unit, net_test_stack_btm
      Tag: #security
      Ignore-AOSP-First: Security
      Change-Id: I3a74bdb0d003cb6bf4f282615be8c68836676715
      70a4d628
  6. Mar 23, 2023
    • Łukasz Rymanowski's avatar
      gatt: Fix handling MTU Exchange request · e778518d
      Łukasz Rymanowski authored
      With this patch Android will always do only one MTU Exchange request as
      per specification. For this reason Android always uses
      GATT_MAX_MTU_SIZE as this is what easly GATT can handle in the Bluetooth
      Stack.
      
      This is done so the single application request cannot block other
      applications from using bigger MTU than the one requested by the first
      application.
      
      For backward compatibility, the for Data Length Extension the MTU from
      the User is used and not the one which was internally requested by the GATT
      
      Bug: 257250188
      Bug: 239776509
      Test: atest BluetoothInstrumentationTests
      Test: manual testing
      Tag: #feature
      Change-Id: I157d40040b53cd4595403d99e58e105709099684
      e778518d
  7. Mar 09, 2023
    • Rahul Arya's avatar
      [Private GATT] Add support for MTU Exchange · 189169e5
      Rahul Arya authored
      Snoop MTU_REQ/RSP packets from legacy stack, and use them to track the
      MTU used in the isolated server.
      
      Bug: 255880936
      Test: unit
      
      Change-Id: Ifcaa35be47abdbf714b592318184701645b55800
      189169e5
  8. Jan 10, 2023
  9. Dec 14, 2022
    • William Escande's avatar
      Remove unused logging · 0a278835
      William Escande authored
      Bug: 245578454
      Test: atest BluetoothInstrumentationTests
      Test: Build + Pre-submit
      Merged-In: If698c5a951043d877a05cf513d82c4d0e50de01b
      Change-Id: If698c5a951043d877a05cf513d82c4d0e50de01b
      0a278835
  10. Dec 12, 2022
    • William Escande's avatar
      Remove unused logging · 204942db
      William Escande authored
      Bug: 245578454
      Test: atest BluetoothInstrumentationTests
      Test: Build + Pre-submit
      Merged-In: If698c5a951043d877a05cf513d82c4d0e50de01b
      Change-Id: If698c5a951043d877a05cf513d82c4d0e50de01b
      (cherry picked from commit f1739af0e4e84c867f37496181f6a7f7effb23d7)
      204942db
  11. Dec 08, 2022
    • William Escande's avatar
      Remove unused logging · 91cac49d
      William Escande authored
      Bug: 245578454
      Test: atest BluetoothInstrumentationTests
      Test: Build + Pre-submit
      Change-Id: If698c5a951043d877a05cf513d82c4d0e50de01b
      (cherry picked from commit f1739af0e4e84c867f37496181f6a7f7effb23d7)
      91cac49d
  12. Jun 22, 2022
    • Łukasz Rymanowski's avatar
      gatt/eatt: Fix qualification test cases · ebdd9f9d
      Łukasz Rymanowski authored
      This patch fixes GATT/SR/GAW/BV-12-C and GATT/SR/GAW/BV-13-C.
      
      Make sure to use proper mtu when preparing response on the EATT channel.
      
      Bug: 235352514
      Test: atest BluetoothInstrumentationTests
      Test: PTS
      Tag: #feature
      Merged-In: I3af2577fe348200d55c9aa781959600b9f9118dc
      Change-Id: I3af2577fe348200d55c9aa781959600b9f9118dc
      (cherry picked from commit 73f5678b)
      ebdd9f9d
  13. Jun 21, 2022
    • Łukasz Rymanowski's avatar
      gatt/eatt: Fix qualification test cases · 73f5678b
      Łukasz Rymanowski authored
      This patch fixes GATT/SR/GAW/BV-12-C and GATT/SR/GAW/BV-13-C.
      
      Make sure to use proper mtu when preparing response on the EATT channel.
      
      Bug: 235352514
      Test: atest BluetoothInstrumentationTests
      Test: PTS
      Tag: #feature
      Change-Id: I3af2577fe348200d55c9aa781959600b9f9118dc
      73f5678b
  14. Apr 04, 2022
  15. Oct 06, 2021
  16. Sep 25, 2021
  17. Sep 23, 2021
  18. Sep 09, 2021
    • Hansong Zhang's avatar
      GATT: Fix data length parameter · 83db2d68
      Hansong Zhang authored
      Should also account for L2CAP header size (4)
      
      Bug: 199009840
      Tag: #feature
      Test: NRF connect
      Change-Id: I6b51a8ef046d81836a4ca4850d052b68e0f4dd46
      83db2d68
  19. Sep 08, 2021
    • Hansong Zhang's avatar
      GATT: Fix data length parameter · c8f161b2
      Hansong Zhang authored
      Should also account for L2CAP header size (4)
      
      Bug: 199009840
      Tag: #feature
      Test: NRF connect
      Change-Id: I6b51a8ef046d81836a4ca4850d052b68e0f4dd46
      c8f161b2
  20. Sep 03, 2021
  21. Jul 01, 2021
    • Zach Johnson's avatar
      More security flag hiding · 4f67dc7c
      Zach Johnson authored
      Bug: 159815595
      Tag: #refactor
      Test: compile & verify basic functions working
      Change-Id: I325719f509d044f14701b6fe1d0706531ee0d417
      4f67dc7c
  22. May 17, 2021
  23. May 06, 2021
  24. Feb 26, 2021
  25. Jan 13, 2021
    • Hansong Zhang's avatar
      GATT: Set data length directly · 213633c9
      Hansong Zhang authored
      Since only GATT, hearing aid (hardcoded), JNI (hidden API) can set data
      length, we just skip L2cap set data length path, and directly send HCI
      command.
      
      Test: cert/run
      Tag: #gd-refactor
      Bug: 141555841
      Change-Id: Id9dd7f9bdea69b025650ff7a287ba55c0d31db75
      213633c9
  26. Dec 22, 2020
  27. Dec 21, 2020
    • HsingYuan Lo's avatar
      Implement robust caching (server) · a3acd5cc
      HsingYuan Lo authored
      Flag:
      - Use flag to enable/disable robust caching on server side
      
      btif_storage
      - Add APIs to set/get/remove database hash and client supported features
      
      Database Hash
      - Add database hash definition into GATT profile
      - Set client to change aware when reading database hash
      
      Client Supported Features
      - Add write check for client supported features characteristic
      - Store client supported feature into btif_storage
      
      Behaviors
      - When a service is added/removed
        . Update database hash
        . Set clients that support robust caching to change unaware
      - After ack for service changed indication is received
        . Set the client to change aware
      - When the client is change unaware
        . Allow request of reading database hash (by handle or by uuid)
        . Allow write_execute, config_mtu and handle_value_conf
        . Send DATABASE_OUT_OF_SYNC error when it is a request
        . Ignore if it is a command
        . After the response is sent, set the client to change aware
      - When a client is set from change unaware to change aware
        . Store current database hash to btif_stroage for that client
      
      Connect and Disconnect:
      - When a tGATT_TCB instance is allocated, load status from btif_storage
      - When disconnected, if the device is untrusted, remove data from btif_storage
      
      Tag: #feature
      Test: atest net_test_stack_gatt_native:GattSrRobustCachingTest
      Bug: 154056389
      Change-Id: I81971012618472dd9e0e6a9e41868caa68998ad4
      a3acd5cc
  28. Oct 20, 2020
  29. Sep 08, 2020
  30. Sep 02, 2020
  31. Aug 05, 2020
    • Hansong Zhang's avatar
      L2cap: remove some l2c_int usage · 1f193a05
      Hansong Zhang authored
      Remove more complicated l2c_int usage in upcoming CL
      
      Bug: 159815595
      Tag: #refactor
      Test: compile & verify basic functions working
      Change-Id: Iff0387d8dc3ef209d1730f3be6271ef5262ecc49
      1f193a05
  32. Mar 13, 2020
  33. Mar 05, 2020
  34. Apr 30, 2019
  35. Apr 26, 2019
  36. Oct 23, 2018
  37. Sep 17, 2018
Loading