1. 25 Feb, 2022 31 commits
  2. 24 Feb, 2022 9 commits
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.17-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · d8152cfe
      Linus Torvalds authored
      Pull pci fixes from Bjorn Helgaas:
      
       - Fix a merge error that broke PCI device enumeration on mvebu
         platforms, including Turris Omnia (Armada 385) (Pali Rohár)
      
       - Avoid using ATS on all AMD Navi10 and Navi14 GPUs because some
         VBIOSes don't account for "harvested" (disabled) parts of the chip
         when initializing caches (Alex Deucher)
      
      * tag 'pci-v5.17-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: Mark all AMD Navi10 and Navi14 GPU ATS as broken
        PCI: mvebu: Fix device enumeration regression
      d8152cfe
    • Linus Torvalds's avatar
      Merge tag 'net-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · f672ff91
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf and netfilter.
      
        Current release - regressions:
      
         - bpf: fix crash due to out of bounds access into reg2btf_ids
      
         - mvpp2: always set port pcs ops, avoid null-deref
      
         - eth: marvell: fix driver load from initrd
      
         - eth: intel: revert "Fix reset bw limit when DCB enabled with 1 TC"
      
        Current release - new code bugs:
      
         - mptcp: fix race in overlapping signal events
      
        Previous releases - regressions:
      
         - xen-netback: revert hotplug-status changes causing devices to not
           be configured
      
         - dsa:
            - avoid call to __dev_set_promiscuity() while rtnl_mutex isn't
              held
            - fix panic when removing unoffloaded port from bridge
      
         - dsa: microchip: fix bridging with more than two member ports
      
        Previous releases - always broken:
      
         - bpf:
            - fix crash due to incorrect copy_map_value when both spin lock
              and timer are present in a single value
            - fix a bpf_timer initialization issue with clang
            - do not try bpf_msg_push_data with len 0
            - add schedule points in batch ops
      
         - nf_tables:
            - unregister flowtable hooks on netns exit
            - correct flow offload action array size
            - fix a couple of memory leaks
      
         - vsock: don't check owner in vhost_vsock_stop() while releasing
      
         - gso: do not skip outer ip header in case of ipip and net_failover
      
         - smc: use a mutex for locking "struct smc_pnettable"
      
         - openvswitch: fix setting ipv6 fields causing hw csum failure
      
         - mptcp: fix race in incoming ADD_ADDR option processing
      
         - sysfs: add check for netdevice being present to speed_show
      
         - sched: act_ct: fix flow table lookup after ct clear or switching
           zones
      
         - eth: intel: fixes for SR-IOV forwarding offloads
      
         - eth: broadcom: fixes for selftests and error recovery
      
         - eth: mellanox: flow steering and SR-IOV forwarding fixes
      
        Misc:
      
         - make __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor
           friends not report freed skbs as drops
      
         - force inlining of checksum functions in net/checksum.h"
      
      * tag 'net-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (85 commits)
        net: mv643xx_eth: process retval from of_get_mac_address
        ping: remove pr_err from ping_lookup
        Revert "i40e: Fix reset bw limit when DCB enabled with 1 TC"
        openvswitch: Fix setting ipv6 fields causing hw csum failure
        ipv6: prevent a possible race condition with lifetimes
        net/smc: Use a mutex for locking "struct smc_pnettable"
        bnx2x: fix driver load from initrd
        Revert "xen-netback: Check for hotplug-status existence before watching"
        Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"
        net/mlx5e: Fix VF min/max rate parameters interchange mistake
        net/mlx5e: Add missing increment of count
        net/mlx5e: MPLSoUDP decap, fix check for unsupported matches
        net/mlx5e: Fix MPLSoUDP encap to use MPLS action information
        net/mlx5e: Add feature check for set fec counters
        net/mlx5e: TC, Skip redundant ct clear actions
        net/mlx5e: TC, Reject rules with forward and drop actions
        net/mlx5e: TC, Reject rules with drop and modify hdr action
        net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets
        net/mlx5e: Fix wrong return value on ioctl EEPROM query failure
        net/mlx5: Fix possible deadlock on rule deletion
        ...
      f672ff91
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix not using conn_timeout · a56a1138
      Luiz Augusto von Dentz authored
      When using hci_le_create_conn_sync it shall wait for the conn_timeout
      since the connection complete may take longer than just 2 seconds.
      
      Also fix the masking of HCI_EV_LE_ENHANCED_CONN_COMPLETE and
      HCI_EV_LE_CONN_COMPLETE so they are never both set so we can predict
      which one the controller will use in case of HCI_OP_LE_CREATE_CONN.
      
      Fixes: 6cd29ec6 ("Bluetooth: hci_sync: Wait for proper events when connecting LE")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      a56a1138
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix hci_update_accept_list_sync · 80740ebb
      Luiz Augusto von Dentz authored
      hci_update_accept_list_sync is returning the filter based on the error
      but that gets overwritten by hci_le_set_addr_resolution_enable_sync
      return instead of using the actual result of the likes of
      hci_le_add_accept_list_sync which was intended.
      
      Fixes: ad383c2c ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      80740ebb
    • Wang Qing's avatar
      Bluetooth: assign len after null check · 2e8ecb4b
      Wang Qing authored
      len should be assigned after a null check
      Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      2e8ecb4b
    • Luiz Augusto von Dentz's avatar
      Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks · 29fb6083
      Luiz Augusto von Dentz authored
      Since bt_skb_sendmmsg can be used with the likes of SOCK_STREAM it
      shall return the partial chunks it could allocate instead of freeing
      everything as otherwise it can cause problems like bellow.
      
      Fixes: 81be03e0 ("Bluetooth: RFCOMM: Replace use of memcpy_from_msg with bt_skb_sendmmsg")
      Reported-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Link: https://lore.kernel.org/r/d7206e12-1b99-c3be-84f4-df22af427ef5@molgen.mpg.de
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215594Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Tested-by: Paul Menzel <pmenzel@molgen.mpg.de> (Nokia N9 (MeeGo/Harmattan)
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      29fb6083
    • Lin Ma's avatar
      Bluetooth: fix data races in smp_unregister(), smp_del_chan() · fa78d2d1
      Lin Ma authored
      Previous commit e0448092 ("Bluetooth: defer cleanup of resources
      in hci_unregister_dev()") defers all destructive actions to
      hci_release_dev() to prevent cocurrent problems like NPD, UAF.
      
      However, there are still some exceptions that are ignored.
      
      The smp_unregister() in hci_dev_close_sync() (previously in
      hci_dev_do_close) will release resources like the sensitive channel
      and the smp_dev objects. Consider the situations the device is detaching
      or power down while the kernel is still operating on it, the following
      data race could take place.
      
      thread-A  hci_dev_close_sync  | thread-B  read_local_oob_ext_data
                                    |
      hci_dev_unlock()              |
      ...                           | hci_dev_lock()
      if (hdev->smp_data)           |
        chan = hdev->smp_data       |
                                    | chan = hdev->smp_data (3)
                                    |
        hdev->smp_data = NULL (1)   | if (!chan || !chan->data) (4)
        ...                         |
        smp = chan->data            | smp = chan->data
        if (smp)                    |
          chan->data = NULL (2)     |
          ...                       |
          kfree_sensitive(smp)      |
                                    | // dereference smp trigger UFA
      
      That is, the objects hdev->smp_data and chan->data both suffer from the
      data races. In a preempt-enable kernel, the above schedule (when (3) is
      before (1) and (4) is before (2)) leads to UAF bugs. It can be
      reproduced in the latest kernel and below is part of the report:
      
      [   49.097146] ================================================================
      [   49.097611] BUG: KASAN: use-after-free in smp_generate_oob+0x2dd/0x570
      [   49.097611] Read of size 8 at addr ffff888006528360 by task generate_oob/155
      [   49.097611]
      [   49.097611] Call Trace:
      [   49.097611]  <TASK>
      [   49.097611]  dump_stack_lvl+0x34/0x44
      [   49.097611]  print_address_description.constprop.0+0x1f/0x150
      [   49.097611]  ? smp_generate_oob+0x2dd/0x570
      [   49.097611]  ? smp_generate_oob+0x2dd/0x570
      [   49.097611]  kasan_report.cold+0x7f/0x11b
      [   49.097611]  ? smp_generate_oob+0x2dd/0x570
      [   49.097611]  smp_generate_oob+0x2dd/0x570
      [   49.097611]  read_local_oob_ext_data+0x689/0xc30
      [   49.097611]  ? hci_event_packet+0xc80/0xc80
      [   49.097611]  ? sysvec_apic_timer_interrupt+0x9b/0xc0
      [   49.097611]  ? asm_sysvec_apic_timer_interrupt+0x12/0x20
      [   49.097611]  ? mgmt_init_hdev+0x1c/0x240
      [   49.097611]  ? mgmt_init_hdev+0x28/0x240
      [   49.097611]  hci_sock_sendmsg+0x1880/0x1e70
      [   49.097611]  ? create_monitor_event+0x890/0x890
      [   49.097611]  ? create_monitor_event+0x890/0x890
      [   49.097611]  sock_sendmsg+0xdf/0x110
      [   49.097611]  __sys_sendto+0x19e/0x270
      [   49.097611]  ? __ia32_sys_getpeername+0xa0/0xa0
      [   49.097611]  ? kernel_fpu_begin_mask+0x1c0/0x1c0
      [   49.097611]  __x64_sys_sendto+0xd8/0x1b0
      [   49.097611]  ? syscall_exit_to_user_mode+0x1d/0x40
      [   49.097611]  do_syscall_64+0x3b/0x90
      [   49.097611]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [   49.097611] RIP: 0033:0x7f5a59f51f64
      ...
      [   49.097611] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5a59f51f64
      [   49.097611] RDX: 0000000000000007 RSI: 00007f5a59d6ac70 RDI: 0000000000000006
      [   49.097611] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
      [   49.097611] R10: 0000000000000040 R11: 0000000000000246 R12: 00007ffec26916ee
      [   49.097611] R13: 00007ffec26916ef R14: 00007f5a59d6afc0 R15: 00007f5a59d6b700
      
      To solve these data races, this patch places the smp_unregister()
      function in the protected area by the hci_dev_lock(). That is, the
      smp_unregister() function can not be concurrently executed when
      operating functions (most of them are mgmt operations in mgmt.c) hold
      the device lock.
      
      This patch is tested with kernel LOCK DEBUGGING enabled. The price from
      the extended holding time of the device lock is supposed to be low as the
      smp_unregister() function is fairly short and efficient.
      Signed-off-by: default avatarLin Ma <linma@zju.edu.cn>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      fa78d2d1
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_core: Fix leaking sent_cmd skb · dd3b1dc3
      Luiz Augusto von Dentz authored
      sent_cmd memory is not freed before freeing hci_dev causing it to leak
      it contents.
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      dd3b1dc3
    • Linus Torvalds's avatar
      Merge tag 'block-5.17-2022-02-24' of git://git.kernel.dk/linux-block · 73878e5e
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request:
          - send H2CData PDUs based on MAXH2CDATA (Varun Prakash)
          - fix passthrough to namespaces with unsupported features (Christoph
            Hellwig)
      
       - Clear iocb->private at poll completion (Stefano)
      
      * tag 'block-5.17-2022-02-24' of git://git.kernel.dk/linux-block:
        nvme-tcp: send H2CData PDUs based on MAXH2CDATA
        nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info
        nvme: don't return an error from nvme_configure_metadata
        block: clear iocb->private in blkdev_bio_end_io_async()
      73878e5e