1. 02 2月, 2021 1 次提交
  2. 29 1月, 2021 4 次提交
  3. 26 1月, 2021 4 次提交
    • B
      Bluetooth: L2CAP: Try harder to accept device not knowing options · 98d2c3e1
      Bastien Nocera 提交于
      The current implementation of L2CAP options negotiation will continue
      the negotiation when a device responds with L2CAP_CONF_UNACCEPT ("unaccepted
      options"), but not when the device replies with L2CAP_CONF_UNKNOWN ("unknown
      options").
      
      Trying to continue the negotiation without ERTM support will allow
      Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
      to connect.
      
      btmon before patch:
      > ACL Data RX: Handle 256 flags 0x02 dlen 16                            #64 [hci0] 59.182702
            L2CAP: Connection Response (0x03) ident 2 len 8
              Destination CID: 64
              Source CID: 64
              Result: Connection successful (0x0000)
              Status: No further information available (0x0000)
      < ACL Data TX: Handle 256 flags 0x00 dlen 23                            #65 [hci0] 59.182744
            L2CAP: Configure Request (0x04) ident 3 len 15
              Destination CID: 64
              Flags: 0x0000
              Option: Retransmission and Flow Control (0x04) [mandatory]
                Mode: Basic (0x00)
                TX window size: 0
                Max transmit: 0
                Retransmission timeout: 0
                Monitor timeout: 0
                Maximum PDU size: 0
      > ACL Data RX: Handle 256 flags 0x02 dlen 16                            #66 [hci0] 59.183948
            L2CAP: Configure Request (0x04) ident 1 len 8
              Destination CID: 64
              Flags: 0x0000
              Option: Maximum Transmission Unit (0x01) [mandatory]
                MTU: 1480
      < ACL Data TX: Handle 256 flags 0x00 dlen 18                            #67 [hci0] 59.183994
            L2CAP: Configure Response (0x05) ident 1 len 10
              Source CID: 64
              Flags: 0x0000
              Result: Success (0x0000)
              Option: Maximum Transmission Unit (0x01) [mandatory]
                MTU: 1480
      > ACL Data RX: Handle 256 flags 0x02 dlen 15                            #69 [hci0] 59.187676
            L2CAP: Configure Response (0x05) ident 3 len 7
              Source CID: 64
              Flags: 0x0000
              Result: Failure - unknown options (0x0003)
              04                                               .
      < ACL Data TX: Handle 256 flags 0x00 dlen 12                            #70 [hci0] 59.187722
            L2CAP: Disconnection Request (0x06) ident 4 len 4
              Destination CID: 64
              Source CID: 64
      > ACL Data RX: Handle 256 flags 0x02 dlen 12                            #73 [hci0] 59.192714
            L2CAP: Disconnection Response (0x07) ident 4 len 4
              Destination CID: 64
              Source CID: 64
      
      btmon after patch:
      > ACL Data RX: Handle 256 flags 0x02 dlen 16                          #248 [hci0] 103.502970
            L2CAP: Connection Response (0x03) ident 5 len 8
              Destination CID: 65
              Source CID: 65
              Result: Connection pending (0x0001)
              Status: No further information available (0x0000)
      > ACL Data RX: Handle 256 flags 0x02 dlen 16                          #249 [hci0] 103.504184
            L2CAP: Connection Response (0x03) ident 5 len 8
              Destination CID: 65
              Source CID: 65
              Result: Connection successful (0x0000)
              Status: No further information available (0x0000)
      < ACL Data TX: Handle 256 flags 0x00 dlen 23                          #250 [hci0] 103.504398
            L2CAP: Configure Request (0x04) ident 6 len 15
              Destination CID: 65
              Flags: 0x0000
              Option: Retransmission and Flow Control (0x04) [mandatory]
                Mode: Basic (0x00)
                TX window size: 0
                Max transmit: 0
                Retransmission timeout: 0
                Monitor timeout: 0
                Maximum PDU size: 0
      > ACL Data RX: Handle 256 flags 0x02 dlen 16                          #251 [hci0] 103.505472
            L2CAP: Configure Request (0x04) ident 3 len 8
              Destination CID: 65
              Flags: 0x0000
              Option: Maximum Transmission Unit (0x01) [mandatory]
                MTU: 1480
      < ACL Data TX: Handle 256 flags 0x00 dlen 18                          #252 [hci0] 103.505689
            L2CAP: Configure Response (0x05) ident 3 len 10
              Source CID: 65
              Flags: 0x0000
              Result: Success (0x0000)
              Option: Maximum Transmission Unit (0x01) [mandatory]
                MTU: 1480
      > ACL Data RX: Handle 256 flags 0x02 dlen 15                          #254 [hci0] 103.509165
            L2CAP: Configure Response (0x05) ident 6 len 7
              Source CID: 65
              Flags: 0x0000
              Result: Failure - unknown options (0x0003)
              04                                               .
      < ACL Data TX: Handle 256 flags 0x00 dlen 12                          #255 [hci0] 103.509426
            L2CAP: Configure Request (0x04) ident 7 len 4
              Destination CID: 65
              Flags: 0x0000
      < ACL Data TX: Handle 256 flags 0x00 dlen 12                          #257 [hci0] 103.511870
            L2CAP: Connection Request (0x02) ident 8 len 4
              PSM: 1 (0x0001)
              Source CID: 66
      > ACL Data RX: Handle 256 flags 0x02 dlen 14                          #259 [hci0] 103.514121
            L2CAP: Configure Response (0x05) ident 7 len 6
              Source CID: 65
              Flags: 0x0000
              Result: Success (0x0000)
      Signed-off-by: NFlorian Dollinger <dollinger.florian@gmx.de>
      Co-developed-by: NFlorian Dollinger <dollinger.florian@gmx.de>
      Reviewed-by: NLuiz Augusto Von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      98d2c3e1
    • L
      Bluetooth: L2CAP: Fix handling fragmented length · 4d7ea8ee
      Luiz Augusto von Dentz 提交于
      Bluetooth Core Specification v5.2, Vol. 3, Part A, section 1.4, table
      1.1:
      
       'Start Fragments always either begin with the first octet of the Basic
        L2CAP header of a PDU or they have a length of zero (see [Vol 2] Part
        B, Section 6.6.2).'
      
      Apparently this was changed by the following errata:
      
      https://www.bluetooth.org/tse/errata_view.cfm?errata_id=10216Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      4d7ea8ee
    • V
      Bluetooth: btusb: fix memory leak on suspend and resume · 5ff20cbe
      Vamshi K Sthambamkadi 提交于
      kmemleak report:
      unreferenced object 0xffff9b1127f00500 (size 208):
        comm "kworker/u17:2", pid 500, jiffies 4294937470 (age 580.136s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 60 ed 05 11 9b ff ff 00 00 00 00 00 00 00 00  .`..............
        backtrace:
          [<000000006ab3fd59>] kmem_cache_alloc_node+0x17a/0x480
          [<0000000051a5f6f9>] __alloc_skb+0x5b/0x1d0
          [<0000000037e2d252>] hci_prepare_cmd+0x32/0xc0 [bluetooth]
          [<0000000010b586d5>] hci_req_add_ev+0x84/0xe0 [bluetooth]
          [<00000000d2deb520>] hci_req_clear_event_filter+0x42/0x70 [bluetooth]
          [<00000000f864bd8c>] hci_req_prepare_suspend+0x84/0x470 [bluetooth]
          [<000000001deb2cc4>] hci_prepare_suspend+0x31/0x40 [bluetooth]
          [<000000002677dd79>] process_one_work+0x209/0x3b0
          [<00000000aaa62b07>] worker_thread+0x34/0x400
          [<00000000826d176c>] kthread+0x126/0x140
          [<000000002305e558>] ret_from_fork+0x22/0x30
      unreferenced object 0xffff9b1125c6ee00 (size 512):
        comm "kworker/u17:2", pid 500, jiffies 4294937470 (age 580.136s)
        hex dump (first 32 bytes):
          04 00 00 00 0d 00 00 00 05 0c 01 00 11 9b ff ff  ................
          00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................
        backtrace:
          [<000000009f07c0cc>] slab_post_alloc_hook+0x59/0x270
          [<0000000049431dc2>] __kmalloc_node_track_caller+0x15f/0x330
          [<00000000027a42f6>] __kmalloc_reserve.isra.70+0x31/0x90
          [<00000000e8e3e76a>] __alloc_skb+0x87/0x1d0
          [<0000000037e2d252>] hci_prepare_cmd+0x32/0xc0 [bluetooth]
          [<0000000010b586d5>] hci_req_add_ev+0x84/0xe0 [bluetooth]
          [<00000000d2deb520>] hci_req_clear_event_filter+0x42/0x70 [bluetooth]
          [<00000000f864bd8c>] hci_req_prepare_suspend+0x84/0x470 [bluetooth]
          [<000000001deb2cc4>] hci_prepare_suspend+0x31/0x40 [bluetooth]
          [<000000002677dd79>] process_one_work+0x209/0x3b0
          [<00000000aaa62b07>] worker_thread+0x34/0x400
          [<00000000826d176c>] kthread+0x126/0x140
          [<000000002305e558>] ret_from_fork+0x22/0x30
      unreferenced object 0xffff9b112b395788 (size 8):
        comm "kworker/u17:2", pid 500, jiffies 4294937470 (age 580.136s)
        hex dump (first 8 bytes):
          20 00 00 00 00 00 04 00                           .......
        backtrace:
          [<0000000052dc28d2>] kmem_cache_alloc_trace+0x15e/0x460
          [<0000000046147591>] alloc_ctrl_urb+0x52/0xe0 [btusb]
          [<00000000a2ed3e9e>] btusb_send_frame+0x91/0x100 [btusb]
          [<000000001e66030e>] hci_send_frame+0x7e/0xf0 [bluetooth]
          [<00000000bf6b7269>] hci_cmd_work+0xc5/0x130 [bluetooth]
          [<000000002677dd79>] process_one_work+0x209/0x3b0
          [<00000000aaa62b07>] worker_thread+0x34/0x400
          [<00000000826d176c>] kthread+0x126/0x140
          [<000000002305e558>] ret_from_fork+0x22/0x30
      
      In pm sleep-resume context, while the btusb device rebinds, it enters
      hci_unregister_dev(), whilst there is a possibility of hdev receiving
      PM_POST_SUSPEND suspend_notifier event, leading to generation of msg
      frames. When hci_unregister_dev() completes, i.e. hdev context is
      destroyed/freed, those intermittently sent msg frames cause memory
      leak.
      
      BUG details:
      Below is stack trace of thread that enters hci_unregister_dev(), marks
      the hdev flag HCI_UNREGISTER to 1, and then goes onto to wait on notifier
      lock - refer unregister_pm_notifier().
      
        hci_unregister_dev+0xa5/0x320 [bluetoot]
        btusb_disconnect+0x68/0x150 [btusb]
        usb_unbind_interface+0x77/0x250
        ? kernfs_remove_by_name_ns+0x75/0xa0
        device_release_driver_internal+0xfe/0x1
        device_release_driver+0x12/0x20
        bus_remove_device+0xe1/0x150
        device_del+0x192/0x3e0
        ? usb_remove_ep_devs+0x1f/0x30
        usb_disable_device+0x92/0x1b0
        usb_disconnect+0xc2/0x270
        hub_event+0x9f6/0x15d0
        ? rpm_idle+0x23/0x360
        ? rpm_idle+0x26b/0x360
        process_one_work+0x209/0x3b0
        worker_thread+0x34/0x400
        ? process_one_work+0x3b0/0x3b0
        kthread+0x126/0x140
        ? kthread_park+0x90/0x90
        ret_from_fork+0x22/0x30
      
      Below is stack trace of thread executing hci_suspend_notifier() which
      processes the PM_POST_SUSPEND event, while the unbinding thread is
      waiting on lock.
      
        hci_suspend_notifier.cold.39+0x5/0x2b [bluetooth]
        blocking_notifier_call_chain+0x69/0x90
        pm_notifier_call_chain+0x1a/0x20
        pm_suspend.cold.9+0x334/0x352
        state_store+0x84/0xf0
        kobj_attr_store+0x12/0x20
        sysfs_kf_write+0x3b/0x40
        kernfs_fop_write+0xda/0x1c0
        vfs_write+0xbb/0x250
        ksys_write+0x61/0xe0
        __x64_sys_write+0x1a/0x20
        do_syscall_64+0x37/0x80
        entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fix hci_suspend_notifer(), not to act on events when flag HCI_UNREGISTER
      is set.
      Signed-off-by: NVamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      5ff20cbe
    • G
      dt-bindings: net: btusb: DT fix s/interrupt-name/interrupt-names/ · f2889889
      Geert Uytterhoeven 提交于
      The standard DT property name is "interrupt-names".
      
      Fixes: fd913ef7 ("Bluetooth: btusb: Add out-of-band wakeup support")
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NRob Herring <robh@kernel.org>
      Reviewed-by: NBrian Norris <briannorris@chromium.org>
      Acked-by: NRajat Jain <rajatja@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      f2889889
  4. 25 1月, 2021 10 次提交
  5. 06 1月, 2021 6 次提交
  6. 28 12月, 2020 1 次提交
  7. 23 12月, 2020 1 次提交
  8. 22 12月, 2020 1 次提交
  9. 19 12月, 2020 12 次提交