1. 26 6月, 2021 16 次提交
    • T
      Bluetooth: mgmt: Fix the command returns garbage parameter value · 02ce2c2c
      Tedd Ho-Jeong An 提交于
      When the Get Device Flags command fails, it returns the error status
      with the parameters filled with the garbage values. Although the
      parameters are not used, it is better to fill with zero than the random
      values.
      Signed-off-by: NTedd Ho-Jeong An <tedd.an@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      02ce2c2c
    • Y
      Bluetooth: disable filter dup when scan for adv monitor · c32d6246
      Yun-Hao Chung 提交于
      Disable duplicates filter when scanning for advertisement monitor for
      the following reasons. The scanning includes active scan and passive
      scan.
      
      For HW pattern filtering (ex. MSFT), Realtek and Qualcomm controllers
      ignore RSSI_Sampling_Period when the duplicates filter is enabled.
      
      For SW pattern filtering, when we're not doing interleaved scanning, it
      is necessary to disable duplicates filter, otherwise hosts can only
      receive one advertisement and it's impossible to know if a peer is still
      in range.
      Signed-off-by: NYun-Hao Chung <howardchung@chromium.org>
      Reviewed-by: NArchie Pusaka <apusaka@chromium.org>
      Reviewed-by: NManish Mandlik <mmandlik@chromium.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c32d6246
    • S
      Bluetooth: Translate additional address type during le_conn_comp · 79699a70
      Sathish Narasimman 提交于
      When using controller based address resolution, then the destination
      address type during le_conn_complete uses 0x02 & 0x03 if controller
      resolves the destination address(RPA).
      These address types need to be converted back into either 0x00 0r 0x01
      Signed-off-by: NSathish Narasimman <sathish.narasimman@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      79699a70
    • Y
      Bluetooth: RFCOMM: Use DEVICE_ATTR_RO macro · c615943e
      YueHaibing 提交于
      Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR,
      which makes the code a bit shorter and easier to read.
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c615943e
    • L
      Bluetooth: L2CAP: Fix invalid access on ECRED Connection response · de895b43
      Luiz Augusto von Dentz 提交于
      The use of l2cap_chan_del is not safe under a loop using
      list_for_each_entry.
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      de895b43
    • L
      Bluetooth: L2CAP: Fix invalid access if ECRED Reconfigure fails · 1fa20d7d
      Luiz Augusto von Dentz 提交于
      The use of l2cap_chan_del is not safe under a loop using
      list_for_each_entry.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      1fa20d7d
    • S
      Bluetooth: Remove spurious error message · 1c58e933
      Szymon Janc 提交于
      Even with rate limited reporting this is very spammy and since
      it is remote device that is providing bogus data there is no
      need to report this as error.
      
      Since real_len variable was used only to allow conditional error
      message it is now also removed.
      
      [72454.143336] bt_err_ratelimited: 10 callbacks suppressed
      [72454.143337] Bluetooth: hci0: advertising data len corrected
      [72454.296314] Bluetooth: hci0: advertising data len corrected
      [72454.892329] Bluetooth: hci0: advertising data len corrected
      [72455.051319] Bluetooth: hci0: advertising data len corrected
      [72455.357326] Bluetooth: hci0: advertising data len corrected
      [72455.663295] Bluetooth: hci0: advertising data len corrected
      [72455.787278] Bluetooth: hci0: advertising data len corrected
      [72455.942278] Bluetooth: hci0: advertising data len corrected
      [72456.094276] Bluetooth: hci0: advertising data len corrected
      [72456.249137] Bluetooth: hci0: advertising data len corrected
      [72459.416333] bt_err_ratelimited: 13 callbacks suppressed
      [72459.416334] Bluetooth: hci0: advertising data len corrected
      [72459.721334] Bluetooth: hci0: advertising data len corrected
      [72460.011317] Bluetooth: hci0: advertising data len corrected
      [72460.327171] Bluetooth: hci0: advertising data len corrected
      [72460.638294] Bluetooth: hci0: advertising data len corrected
      [72460.946350] Bluetooth: hci0: advertising data len corrected
      [72461.225320] Bluetooth: hci0: advertising data len corrected
      [72461.690322] Bluetooth: hci0: advertising data len corrected
      [72462.118318] Bluetooth: hci0: advertising data len corrected
      [72462.427319] Bluetooth: hci0: advertising data len corrected
      [72464.546319] bt_err_ratelimited: 7 callbacks suppressed
      [72464.546319] Bluetooth: hci0: advertising data len corrected
      [72464.857318] Bluetooth: hci0: advertising data len corrected
      [72465.163332] Bluetooth: hci0: advertising data len corrected
      [72465.278331] Bluetooth: hci0: advertising data len corrected
      [72465.432323] Bluetooth: hci0: advertising data len corrected
      [72465.891334] Bluetooth: hci0: advertising data len corrected
      [72466.045334] Bluetooth: hci0: advertising data len corrected
      [72466.197321] Bluetooth: hci0: advertising data len corrected
      [72466.340318] Bluetooth: hci0: advertising data len corrected
      [72466.498335] Bluetooth: hci0: advertising data len corrected
      [72469.803299] bt_err_ratelimited: 10 callbacks suppressed
      Signed-off-by: NSzymon Janc <szymon.janc@codecoup.pl>
      Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=203753
      Cc: stable@vger.kernel.org
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      1c58e933
    • K
      Bluetooth: Shutdown controller after workqueues are flushed or cancelled · 0ea9fd00
      Kai-Heng Feng 提交于
      Rfkill block and unblock Intel USB Bluetooth [8087:0026] may make it
      stops working:
      [  509.691509] Bluetooth: hci0: HCI reset during shutdown failed
      [  514.897584] Bluetooth: hci0: MSFT filter_enable is already on
      [  530.044751] usb 3-10: reset full-speed USB device number 5 using xhci_hcd
      [  545.660350] usb 3-10: device descriptor read/64, error -110
      [  561.283530] usb 3-10: device descriptor read/64, error -110
      [  561.519682] usb 3-10: reset full-speed USB device number 5 using xhci_hcd
      [  566.686650] Bluetooth: hci0: unexpected event for opcode 0x0500
      [  568.752452] Bluetooth: hci0: urb 0000000096cd309b failed to resubmit (113)
      [  578.797955] Bluetooth: hci0: Failed to read MSFT supported features (-110)
      [  586.286565] Bluetooth: hci0: urb 00000000c522f633 failed to resubmit (113)
      [  596.215302] Bluetooth: hci0: Failed to read MSFT supported features (-110)
      
      Or kernel panics because other workqueues already freed skb:
      [ 2048.663763] BUG: kernel NULL pointer dereference, address: 0000000000000000
      [ 2048.663775] #PF: supervisor read access in kernel mode
      [ 2048.663779] #PF: error_code(0x0000) - not-present page
      [ 2048.663782] PGD 0 P4D 0
      [ 2048.663787] Oops: 0000 [#1] SMP NOPTI
      [ 2048.663793] CPU: 3 PID: 4491 Comm: rfkill Tainted: G        W         5.13.0-rc1-next-20210510+ #20
      [ 2048.663799] Hardware name: HP HP EliteBook 850 G8 Notebook PC/8846, BIOS T76 Ver. 01.01.04 12/02/2020
      [ 2048.663801] RIP: 0010:__skb_ext_put+0x6/0x50
      [ 2048.663814] Code: 8b 1b 48 85 db 75 db 5b 41 5c 5d c3 be 01 00 00 00 e8 de 13 c0 ff eb e7 be 02 00 00 00 e8 d2 13 c0 ff eb db 0f 1f 44 00 00 55 <8b> 07 48 89 e5 83 f8 01 74 14 b8 ff ff ff ff f0 0f c1
      07 83 f8 01
      [ 2048.663819] RSP: 0018:ffffc1d105b6fd80 EFLAGS: 00010286
      [ 2048.663824] RAX: 0000000000000000 RBX: ffff9d9ac5649000 RCX: 0000000000000000
      [ 2048.663827] RDX: ffffffffc0d1daf6 RSI: 0000000000000206 RDI: 0000000000000000
      [ 2048.663830] RBP: ffffc1d105b6fd98 R08: 0000000000000001 R09: ffff9d9ace8ceac0
      [ 2048.663834] R10: ffff9d9ace8ceac0 R11: 0000000000000001 R12: ffff9d9ac5649000
      [ 2048.663838] R13: 0000000000000000 R14: 00007ffe0354d650 R15: 0000000000000000
      [ 2048.663843] FS:  00007fe02ab19740(0000) GS:ffff9d9e5f8c0000(0000) knlGS:0000000000000000
      [ 2048.663849] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 2048.663853] CR2: 0000000000000000 CR3: 0000000111a52004 CR4: 0000000000770ee0
      [ 2048.663856] PKRU: 55555554
      [ 2048.663859] Call Trace:
      [ 2048.663865]  ? skb_release_head_state+0x5e/0x80
      [ 2048.663873]  kfree_skb+0x2f/0xb0
      [ 2048.663881]  btusb_shutdown_intel_new+0x36/0x60 [btusb]
      [ 2048.663905]  hci_dev_do_close+0x48c/0x5e0 [bluetooth]
      [ 2048.663954]  ? __cond_resched+0x1a/0x50
      [ 2048.663962]  hci_rfkill_set_block+0x56/0xa0 [bluetooth]
      [ 2048.664007]  rfkill_set_block+0x98/0x170
      [ 2048.664016]  rfkill_fop_write+0x136/0x1e0
      [ 2048.664022]  vfs_write+0xc7/0x260
      [ 2048.664030]  ksys_write+0xb1/0xe0
      [ 2048.664035]  ? exit_to_user_mode_prepare+0x37/0x1c0
      [ 2048.664042]  __x64_sys_write+0x1a/0x20
      [ 2048.664048]  do_syscall_64+0x40/0xb0
      [ 2048.664055]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [ 2048.664060] RIP: 0033:0x7fe02ac23c27
      [ 2048.664066] Code: 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
      [ 2048.664070] RSP: 002b:00007ffe0354d638 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 2048.664075] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007fe02ac23c27
      [ 2048.664078] RDX: 0000000000000008 RSI: 00007ffe0354d650 RDI: 0000000000000003
      [ 2048.664081] RBP: 0000000000000000 R08: 0000559b05998440 R09: 0000559b05998440
      [ 2048.664084] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003
      [ 2048.664086] R13: 0000000000000000 R14: ffffffff00000000 R15: 00000000ffffffff
      
      So move the shutdown callback to a place where workqueues are either
      flushed or cancelled to resolve the issue.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0ea9fd00
    • K
      Bluetooth: Fix alt settings for incoming SCO with transparent coding format · 06d213d8
      Kiran K 提交于
      For incoming SCO connection with transparent coding format, alt setting
      of CVSD is getting applied instead of Transparent.
      
      Before fix:
      < HCI Command: Accept Synchron.. (0x01|0x0029) plen 21  #2196 [hci0] 321.342548
              Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
              Transmit bandwidth: 8000
              Receive bandwidth: 8000
              Max latency: 13
              Setting: 0x0003
                Input Coding: Linear
                Input Data Format: 1's complement
                Input Sample Size: 8-bit
                # of bits padding at MSB: 0
                Air Coding Format: Transparent Data
              Retransmission effort: Optimize for link quality (0x02)
              Packet type: 0x003f
                HV1 may be used
                HV2 may be used
                HV3 may be used
                EV3 may be used
                EV4 may be used
                EV5 may be used
      > HCI Event: Command Status (0x0f) plen 4               #2197 [hci0] 321.343585
            Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
              Status: Success (0x00)
      > HCI Event: Synchronous Connect Comp.. (0x2c) plen 17  #2198 [hci0] 321.351666
              Status: Success (0x00)
              Handle: 257
              Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
              Link type: eSCO (0x02)
              Transmission interval: 0x0c
              Retransmission window: 0x04
              RX packet length: 60
              TX packet length: 60
              Air mode: Transparent (0x03)
      ........
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2336 [hci0] 321.383655
      < SCO Data TX: Handle 257 flags 0x00 dlen 60            #2337 [hci0] 321.389558
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2338 [hci0] 321.393615
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2339 [hci0] 321.393618
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2340 [hci0] 321.393618
      < SCO Data TX: Handle 257 flags 0x00 dlen 60            #2341 [hci0] 321.397070
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2342 [hci0] 321.403622
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2343 [hci0] 321.403625
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2344 [hci0] 321.403625
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2345 [hci0] 321.403625
      < SCO Data TX: Handle 257 flags 0x00 dlen 60            #2346 [hci0] 321.404569
      < SCO Data TX: Handle 257 flags 0x00 dlen 60            #2347 [hci0] 321.412091
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2348 [hci0] 321.413626
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2349 [hci0] 321.413630
      > SCO Data RX: Handle 257 flags 0x00 dlen 48            #2350 [hci0] 321.413630
      < SCO Data TX: Handle 257 flags 0x00 dlen 60            #2351 [hci0] 321.419674
      
      After fix:
      
      < HCI Command: Accept Synchronou.. (0x01|0x0029) plen 21  #309 [hci0] 49.439693
              Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
              Transmit bandwidth: 8000
              Receive bandwidth: 8000
              Max latency: 13
              Setting: 0x0003
                Input Coding: Linear
                Input Data Format: 1's complement
                Input Sample Size: 8-bit
                # of bits padding at MSB: 0
                Air Coding Format: Transparent Data
              Retransmission effort: Optimize for link quality (0x02)
              Packet type: 0x003f
                HV1 may be used
                HV2 may be used
                HV3 may be used
                EV3 may be used
                EV4 may be used
                EV5 may be used
      > HCI Event: Command Status (0x0f) plen 4                 #310 [hci0] 49.440308
            Accept Synchronous Connection Request (0x01|0x0029) ncmd 1
              Status: Success (0x00)
      > HCI Event: Synchronous Connect Complete (0x2c) plen 17  #311 [hci0] 49.449308
              Status: Success (0x00)
              Handle: 257
              Address: 1C:CC:D6:E2:EA:80 (Xiaomi Communications Co Ltd)
              Link type: eSCO (0x02)
              Transmission interval: 0x0c
              Retransmission window: 0x04
              RX packet length: 60
              TX packet length: 60
              Air mode: Transparent (0x03)
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #312 [hci0] 49.450421
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #313 [hci0] 49.457927
      > HCI Event: Max Slots Change (0x1b) plen 3               #314 [hci0] 49.460345
              Handle: 256
              Max slots: 5
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #315 [hci0] 49.465453
      > SCO Data RX: Handle 257 flags 0x00 dlen 60              #316 [hci0] 49.470502
      > SCO Data RX: Handle 257 flags 0x00 dlen 60              #317 [hci0] 49.470519
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #318 [hci0] 49.472996
      > SCO Data RX: Handle 257 flags 0x00 dlen 60              #319 [hci0] 49.480412
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #320 [hci0] 49.480492
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #321 [hci0] 49.487989
      > SCO Data RX: Handle 257 flags 0x00 dlen 60              #322 [hci0] 49.490303
      < SCO Data TX: Handle 257 flags 0x00 dlen 60              #323 [hci0] 49.495496
      > SCO Data RX: Handle 257 flags 0x00 dlen 60              #324 [hci0] 49.500304
      > SCO Data RX: Handle 257 flags 0x00 dlen 60              #325 [hci0] 49.500311
      Signed-off-by: NKiran K <kiran.k@intel.com>
      Signed-off-by: NLokendra Singh <lokendra.singh@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      06d213d8
    • J
      Bluetooth: 6lowpan: remove unused function · b0e56db7
      Jiapeng Chong 提交于
      Fix the following clang warning:
      
      net/bluetooth/6lowpan.c:913:20: warning: unused function 'bdaddr_type'
      [-Wunused-function].
      
      net/bluetooth/6lowpan.c:106:35: warning: unused function
      'peer_lookup_ba' [-Wunused-function].
      Reported-by: NAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: NJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      b0e56db7
    • M
      Bluetooth: Add ncmd=0 recovery handling · de75cd0d
      Manish Mandlik 提交于
      During command status or command complete event, the controller may set
      ncmd=0 indicating that it is not accepting any more commands. In such a
      case, host holds off sending any more commands to the controller. If the
      controller doesn't recover from such condition, host will wait forever,
      until the user decides that the Bluetooth is broken and may power cycles
      the Bluetooth.
      
      This patch triggers the hardware error to reset the controller and
      driver when it gets into such state as there is no other wat out.
      Reviewed-by: NAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
      Signed-off-by: NManish Mandlik <mmandlik@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      de75cd0d
    • Y
      Bluetooth: Fix the HCI to MGMT status conversion table · 4ef36a52
      Yu Liu 提交于
      0x2B, 0x31 and 0x33 are reserved for future use but were not present in
      the HCI to MGMT conversion table, this caused the conversion to be
      incorrect for the HCI status code greater than 0x2A.
      Reviewed-by: NMiao-chen Chou <mcchou@chromium.org>
      Signed-off-by: NYu Liu <yudiliu@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      4ef36a52
    • T
      Bluetooth: cmtp: fix file refcount when cmtp_attach_device fails · 3cfdf8fc
      Thadeu Lima de Souza Cascardo 提交于
      When cmtp_attach_device fails, cmtp_add_connection returns the error value
      which leads to the caller to doing fput through sockfd_put. But
      cmtp_session kthread, which is stopped in this path will also call fput,
      leading to a potential refcount underflow or a use-after-free.
      
      Add a refcount before we signal the kthread to stop. The kthread will try
      to grab the cmtp_session_sem mutex before doing the fput, which is held
      when get_file is called, so there should be no races there.
      
      Reported-by: Ryota Shiga
      Signed-off-by: NThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      3cfdf8fc
    • Y
      Bluetooth: Return whether a connection is outbound · 1c6ed31b
      Yu Liu 提交于
      When an MGMT_EV_DEVICE_CONNECTED event is reported back to the user
      space we will set the flags to tell if the established connection is
      outbound or not. This is useful for the user space to log better metrics
      and error messages.
      Reviewed-by: NMiao-chen Chou <mcchou@chromium.org>
      Reviewed-by: NAlain Michaud <alainm@chromium.org>
      Signed-off-by: NYu Liu <yudiliu@google.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      1c6ed31b
    • Q
      Bluetooth: use flexible-array member instead of zero-length array · 07d85dbe
      Qiheng Lin 提交于
      Fix the following coccicheck warning:
      
      net/bluetooth/msft.c:37:6-13: WARNING use flexible-array member instead
      net/bluetooth/msft.c:42:6-10: WARNING use flexible-array member instead
      net/bluetooth/msft.c:52:6-10: WARNING use flexible-array member instead
      Signed-off-by: NQiheng Lin <linqiheng@huawei.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      07d85dbe
    • K
      Bluetooth: 6lowpan: delete unneeded variable initialization · c469c9c9
      Kai Ye 提交于
      Delete unneeded variable initialization.
      Signed-off-by: NKai Ye <yekai13@huawei.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c469c9c9
  2. 15 6月, 2021 1 次提交
  3. 03 6月, 2021 1 次提交
  4. 31 5月, 2021 1 次提交
  5. 28 5月, 2021 1 次提交
    • L
      Bluetooth: fix the erroneous flush_work() order · 6a137cae
      Lin Ma 提交于
      In the cleanup routine for failed initialization of HCI device,
      the flush_work(&hdev->rx_work) need to be finished before the
      flush_work(&hdev->cmd_work). Otherwise, the hci_rx_work() can
      possibly invoke new cmd_work and cause a bug, like double free,
      in late processings.
      
      This was assigned CVE-2021-3564.
      
      This patch reorder the flush_work() to fix this bug.
      
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: linux-bluetooth@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NLin Ma <linma@zju.edu.cn>
      Signed-off-by: NHao Xiong <mart1n@zju.edu.cn>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      6a137cae
  6. 28 4月, 2021 1 次提交
    • L
      Fix misc new gcc warnings · e7c6e405
      Linus Torvalds 提交于
      It seems like Fedora 34 ends up enabling a few new gcc warnings, notably
      "-Wstringop-overread" and "-Warray-parameter".
      
      Both of them cause what seem to be valid warnings in the kernel, where
      we have array size mismatches in function arguments (that are no longer
      just silently converted to a pointer to element, but actually checked).
      
      This fixes most of the trivial ones, by making the function declaration
      match the function definition, and in the case of intel_pm.c, removing
      the over-specified array size from the argument declaration.
      
      At least one 'stringop-overread' warning remains in the i915 driver, but
      that one doesn't have the same obvious trivial fix, and may or may not
      actually be indicative of a bug.
      
      [ It was a mistake to upgrade one of my machines to Fedora 34 while
        being busy with the merge window, but if this is the extent of the
        compiler upgrade problems, things are better than usual    - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e7c6e405
  7. 23 4月, 2021 1 次提交
    • L
      bluetooth: eliminate the potential race condition when removing the HCI controller · e2cb6b89
      Lin Ma 提交于
      There is a possible race condition vulnerability between issuing a HCI
      command and removing the cont.  Specifically, functions hci_req_sync()
      and hci_dev_do_close() can race each other like below:
      
      thread-A in hci_req_sync()      |   thread-B in hci_dev_do_close()
                                      |   hci_req_sync_lock(hdev);
      test_bit(HCI_UP, &hdev->flags); |
      ...                             |   test_and_clear_bit(HCI_UP, &hdev->flags)
      hci_req_sync_lock(hdev);        |
                                      |
      In this commit we alter the sequence in function hci_req_sync(). Hence,
      the thread-A cannot issue th.
      Signed-off-by: NLin Ma <linma@zju.edu.cn>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Fixes: 7c6a329e ("[Bluetooth] Fix regression from using default link policy")
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2cb6b89
  8. 08 4月, 2021 2 次提交
  9. 07 4月, 2021 1 次提交
  10. 06 4月, 2021 5 次提交
  11. 02 4月, 2021 4 次提交
  12. 27 3月, 2021 5 次提交
  13. 25 3月, 2021 1 次提交