1. 14 Jul, 2022 2 commits
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · f46a5a9c
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2022-07-12
      
      This series contains updates to ice driver only.
      
      Paul fixes detection of E822 devices for firmware update and changes NVM
      read for snapshot creation to be done in chunks as some systems cannot
      read the entire NVM in the allotted time.
      ====================
      
      Link: https://lore.kernel.org/r/20220712164829.7275-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f46a5a9c
    • Íñigo Huguet's avatar
      sfc: fix use after free when disabling sriov · ebe41da5
      Íñigo Huguet authored
      Use after free is detected by kfence when disabling sriov. What was read
      after being freed was vf->pci_dev: it was freed from pci_disable_sriov
      and later read in efx_ef10_sriov_free_vf_vports, called from
      efx_ef10_sriov_free_vf_vswitching.
      
      Set the pointer to NULL at release time to not trying to read it later.
      
      Reproducer and dmesg log (note that kfence doesn't detect it every time):
      $ echo 1 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs
      $ echo 0 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs
      
       BUG: KFENCE: use-after-free read in efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc]
      
       Use-after-free read at 0x00000000ff3c1ba5 (in kfence-#224):
        efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc]
        efx_ef10_pci_sriov_disable+0x38/0x70 [sfc]
        efx_pci_sriov_configure+0x24/0x40 [sfc]
        sriov_numvfs_store+0xfe/0x140
        kernfs_fop_write_iter+0x11c/0x1b0
        new_sync_write+0x11f/0x1b0
        vfs_write+0x1eb/0x280
        ksys_write+0x5f/0xe0
        do_syscall_64+0x5c/0x80
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
       kfence-#224: 0x00000000edb8ef95-0x00000000671f5ce1, size=2792, cache=kmalloc-4k
      
       allocated by task 6771 on cpu 10 at 3137.860196s:
        pci_alloc_dev+0x21/0x60
        pci_iov_add_virtfn+0x2a2/0x320
        sriov_enable+0x212/0x3e0
        efx_ef10_sriov_configure+0x67/0x80 [sfc]
        efx_pci_sriov_configure+0x24/0x40 [sfc]
        sriov_numvfs_store+0xba/0x140
        kernfs_fop_write_iter+0x11c/0x1b0
        new_sync_write+0x11f/0x1b0
        vfs_write+0x1eb/0x280
        ksys_write+0x5f/0xe0
        do_syscall_64+0x5c/0x80
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
       freed by task 6771 on cpu 12 at 3170.991309s:
        device_release+0x34/0x90
        kobject_cleanup+0x3a/0x130
        pci_iov_remove_virtfn+0xd9/0x120
        sriov_disable+0x30/0xe0
        efx_ef10_pci_sriov_disable+0x57/0x70 [sfc]
        efx_pci_sriov_configure+0x24/0x40 [sfc]
        sriov_numvfs_store+0xfe/0x140
        kernfs_fop_write_iter+0x11c/0x1b0
        new_sync_write+0x11f/0x1b0
        vfs_write+0x1eb/0x280
        ksys_write+0x5f/0xe0
        do_syscall_64+0x5c/0x80
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: 3c5eb876 ("sfc: create vports for VFs and assign random MAC addresses")
      Reported-by: default avatarYanghang Liu <yanghliu@redhat.com>
      Signed-off-by: default avatarÍñigo Huguet <ihuguet@redhat.com>
      Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
      Link: https://lore.kernel.org/r/20220712062642.6915-1-ihuguet@redhat.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ebe41da5
  2. 13 Jul, 2022 27 commits
  3. 12 Jul, 2022 4 commits
  4. 11 Jul, 2022 5 commits
  5. 09 Jul, 2022 2 commits
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: replace BUG_ON by element length check · c39ba4de
      Pablo Neira Ayuso authored
      BUG_ON can be triggered from userspace with an element with a large
      userdata area. Replace it by length check and return EINVAL instead.
      Over time extensions have been growing in size.
      
      Pick a sufficiently old Fixes: tag to propagate this fix.
      
      Fixes: 7d740264 ("netfilter: nf_tables: variable sized set element keys / data")
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c39ba4de
    • Eric Dumazet's avatar
      vlan: fix memory leak in vlan_newlink() · 72a0b329
      Eric Dumazet authored
      Blamed commit added back a bug I fixed in commit 9bbd917e
      ("vlan: fix memory leak in vlan_dev_set_egress_priority")
      
      If a memory allocation fails in vlan_changelink() after other allocations
      succeeded, we need to call vlan_dev_free_egress_priority()
      to free all allocated memory because after a failed ->newlink()
      we do not call any methods like ndo_uninit() or dev->priv_destructor().
      
      In following example, if the allocation for last element 2000:2001 fails,
      we need to free eight prior allocations:
      
      ip link add link dummy0 dummy0.100 type vlan id 100 \
      	egress-qos-map 1:2 2:3 3:4 4:5 5:6 6:7 7:8 8:9 2000:2001
      
      syzbot report was:
      
      BUG: memory leak
      unreferenced object 0xffff888117bd1060 (size 32):
      comm "syz-executor408", pid 3759, jiffies 4294956555 (age 34.090s)
      hex dump (first 32 bytes):
      09 00 00 00 00 a0 00 00 00 00 00 00 00 00 00 00 ................
      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
      backtrace:
      [<ffffffff83fc60ad>] kmalloc include/linux/slab.h:600 [inline]
      [<ffffffff83fc60ad>] vlan_dev_set_egress_priority+0xed/0x170 net/8021q/vlan_dev.c:193
      [<ffffffff83fc6628>] vlan_changelink+0x178/0x1d0 net/8021q/vlan_netlink.c:128
      [<ffffffff83fc67c8>] vlan_newlink+0x148/0x260 net/8021q/vlan_netlink.c:185
      [<ffffffff838b1278>] rtnl_newlink_create net/core/rtnetlink.c:3363 [inline]
      [<ffffffff838b1278>] __rtnl_newlink+0xa58/0xdc0 net/core/rtnetlink.c:3580
      [<ffffffff838b1629>] rtnl_newlink+0x49/0x70 net/core/rtnetlink.c:3593
      [<ffffffff838ac66c>] rtnetlink_rcv_msg+0x21c/0x5c0 net/core/rtnetlink.c:6089
      [<ffffffff839f9c37>] netlink_rcv_skb+0x87/0x1d0 net/netlink/af_netlink.c:2501
      [<ffffffff839f8da7>] netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
      [<ffffffff839f8da7>] netlink_unicast+0x397/0x4c0 net/netlink/af_netlink.c:1345
      [<ffffffff839f9266>] netlink_sendmsg+0x396/0x710 net/netlink/af_netlink.c:1921
      [<ffffffff8384dbf6>] sock_sendmsg_nosec net/socket.c:714 [inline]
      [<ffffffff8384dbf6>] sock_sendmsg+0x56/0x80 net/socket.c:734
      [<ffffffff8384e15c>] ____sys_sendmsg+0x36c/0x390 net/socket.c:2488
      [<ffffffff838523cb>] ___sys_sendmsg+0x8b/0xd0 net/socket.c:2542
      [<ffffffff838525b8>] __sys_sendmsg net/socket.c:2571 [inline]
      [<ffffffff838525b8>] __do_sys_sendmsg net/socket.c:2580 [inline]
      [<ffffffff838525b8>] __se_sys_sendmsg net/socket.c:2578 [inline]
      [<ffffffff838525b8>] __x64_sys_sendmsg+0x78/0xf0 net/socket.c:2578
      [<ffffffff845ad8d5>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
      [<ffffffff845ad8d5>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
      [<ffffffff8460006a>] entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      Fixes: 37aa50c5 ("vlan: introduce vlan_dev_free_egress_priority")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Xin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      72a0b329