1. 16 Dec, 2021 8 commits
  2. 15 Dec, 2021 12 commits
    • Cyril Novikov's avatar
      ixgbe: set X550 MDIO speed before talking to PHY · bf0a3750
      Cyril Novikov authored
      The MDIO bus speed must be initialized before talking to the PHY the first
      time in order to avoid talking to it using a speed that the PHY doesn't
      support.
      
      This fixes HW initialization error -17 (IXGBE_ERR_PHY_ADDR_INVALID) on
      Denverton CPUs (a.k.a. the Atom C3000 family) on ports with a 10Gb network
      plugged in. On those devices, HLREG0[MDCSPD] resets to 1, which combined
      with the 10Gb network results in a 24MHz MDIO speed, which is apparently
      too fast for the connected PHY. PHY register reads over MDIO bus return
      garbage, leading to initialization failure.
      
      Reproduced with Linux kernel 4.19 and 5.15-rc7. Can be reproduced using
      the following setup:
      
      * Use an Atom C3000 family system with at least one X552 LAN on the SoC
      * Disable PXE or other BIOS network initialization if possible
        (the interface must not be initialized before Linux boots)
      * Connect a live 10Gb Ethernet cable to an X550 port
      * Power cycle (not reset, doesn't always work) the system and boot Linux
      * Observe: ixgbe interfaces w/ 10GbE cables plugged in fail with error -17
      
      Fixes: e84db727 ("ixgbe: Introduce function to control MDIO speed")
      Signed-off-by: default avatarCyril Novikov <cnovikov@lynx.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      bf0a3750
    • Robert Schlabbach's avatar
      ixgbe: Document how to enable NBASE-T support · 271225fd
      Robert Schlabbach authored
      Commit a296d665 ("ixgbe: Add ethtool support to enable 2.5 and 5.0
      Gbps support") introduced suppression of the advertisement of NBASE-T
      speeds by default, according to Todd Fujinaka to accommodate customers
      with network switches which could not cope with advertised NBASE-T
      speeds, as posted in the E1000-devel mailing list:
      
      https://sourceforge.net/p/e1000/mailman/message/37106269/
      
      However, the suppression was not documented at all, nor was how to
      enable NBASE-T support.
      
      Properly document the NBASE-T suppression and how to enable NBASE-T
      support.
      
      Fixes: a296d665 ("ixgbe: Add ethtool support to enable 2.5 and 5.0 Gbps support")
      Reported-by: default avatarRobert Schlabbach <robert_s@gmx.net>
      Signed-off-by: default avatarRobert Schlabbach <robert_s@gmx.net>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      271225fd
    • Sasha Neftin's avatar
      igc: Fix typo in i225 LTR functions · 0182d1f3
      Sasha Neftin authored
      The LTR maximum value was incorrectly written using the scale from
      the LTR minimum value. This would cause incorrect values to be sent,
      in cases where the initial calculation lead to different min/max scales.
      
      Fixes: 707abf06 ("igc: Add initial LTR support")
      Suggested-by: default avatarDima Ruinskiy <dima.ruinskiy@intel.com>
      Signed-off-by: default avatarSasha Neftin <sasha.neftin@intel.com>
      Tested-by: default avatarNechama Kraus <nechamax.kraus@linux.intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      0182d1f3
    • Letu Ren's avatar
      igbvf: fix double free in `igbvf_probe` · b6d335a6
      Letu Ren authored
      In `igbvf_probe`, if register_netdev() fails, the program will go to
      label err_hw_init, and then to label err_ioremap. In free_netdev() which
      is just below label err_ioremap, there is `list_for_each_entry_safe` and
      `netif_napi_del` which aims to delete all entries in `dev->napi_list`.
      The program has added an entry `adapter->rx_ring->napi` which is added by
      `netif_napi_add` in igbvf_alloc_queues(). However, adapter->rx_ring has
      been freed below label err_hw_init. So this a UAF.
      
      In terms of how to patch the problem, we can refer to igbvf_remove() and
      delete the entry before `adapter->rx_ring`.
      
      The KASAN logs are as follows:
      
      [   35.126075] BUG: KASAN: use-after-free in free_netdev+0x1fd/0x450
      [   35.127170] Read of size 8 at addr ffff88810126d990 by task modprobe/366
      [   35.128360]
      [   35.128643] CPU: 1 PID: 366 Comm: modprobe Not tainted 5.15.0-rc2+ #14
      [   35.129789] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014
      [   35.131749] Call Trace:
      [   35.132199]  dump_stack_lvl+0x59/0x7b
      [   35.132865]  print_address_description+0x7c/0x3b0
      [   35.133707]  ? free_netdev+0x1fd/0x450
      [   35.134378]  __kasan_report+0x160/0x1c0
      [   35.135063]  ? free_netdev+0x1fd/0x450
      [   35.135738]  kasan_report+0x4b/0x70
      [   35.136367]  free_netdev+0x1fd/0x450
      [   35.137006]  igbvf_probe+0x121d/0x1a10 [igbvf]
      [   35.137808]  ? igbvf_vlan_rx_add_vid+0x100/0x100 [igbvf]
      [   35.138751]  local_pci_probe+0x13c/0x1f0
      [   35.139461]  pci_device_probe+0x37e/0x6c0
      [   35.165526]
      [   35.165806] Allocated by task 366:
      [   35.166414]  ____kasan_kmalloc+0xc4/0xf0
      [   35.167117]  foo_kmem_cache_alloc_trace+0x3c/0x50 [igbvf]
      [   35.168078]  igbvf_probe+0x9c5/0x1a10 [igbvf]
      [   35.168866]  local_pci_probe+0x13c/0x1f0
      [   35.169565]  pci_device_probe+0x37e/0x6c0
      [   35.179713]
      [   35.179993] Freed by task 366:
      [   35.180539]  kasan_set_track+0x4c/0x80
      [   35.181211]  kasan_set_free_info+0x1f/0x40
      [   35.181942]  ____kasan_slab_free+0x103/0x140
      [   35.182703]  kfree+0xe3/0x250
      [   35.183239]  igbvf_probe+0x1173/0x1a10 [igbvf]
      [   35.184040]  local_pci_probe+0x13c/0x1f0
      
      Fixes: d4e0fe01 (igbvf: add new driver to support 82576 virtual functions)
      Reported-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarLetu Ren <fantasquex@gmail.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      b6d335a6
    • Karen Sornek's avatar
      igb: Fix removal of unicast MAC filters of VFs · 584af821
      Karen Sornek authored
      Move checking condition of VF MAC filter before clearing
      or adding MAC filter to VF to prevent potential blackout caused
      by removal of necessary and working VF's MAC filter.
      
      Fixes: 1b8b062a ("igb: add VF trust infrastructure")
      Signed-off-by: default avatarKaren Sornek <karen.sornek@intel.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      584af821
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-2021-12-15' of... · 1d1c950f
      David S. Miller authored
      Merge tag 'wireless-drivers-2021-12-15' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.16
      
      Second set of fixes for v5.16, hopefully also the last one. I changed
      my email in MAINTAINERS, one crash fix in iwlwifi and some build
      problems fixed.
      
      iwlwifi
      
      * fix crash caused by a warning
      
      * fix LED linking problem
      
      brcmsmac
      
      * rework LED dependencies for being consistent with other drivers
      
      mt76
      
      * mt7921: fix build regression
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d1c950f
    • David S. Miller's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 7c8089f9
      David S. Miller authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2021-12-14
      
      This series contains updates to ice driver only.
      
      Karol corrects division that was causing incorrect calculations and
      adds a check to ensure stale timestamps are not being used.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c8089f9
    • Jakub Kicinski's avatar
      Merge branch 'mptcp-fixes-for-ulp-a-deadlock-and-netlink-docs' · 500f3720
      Jakub Kicinski authored
      Mat Martineau says:
      
      ====================
      mptcp: Fixes for ULP, a deadlock, and netlink docs
      
      Two of the MPTCP fixes in this set are related to the TCP_ULP socket
      option with MPTCP sockets operating in "fallback" mode (the connection
      has reverted to regular TCP). The other issues are an observed deadlock
      and missing parameter documentation in the MPTCP netlink API.
      
      Patch 1 marks TCP_ULP as unsupported earlier in MPTCP setsockopt code,
      so the fallback code path in the MPTCP layer does not pass the TCP_ULP
      option down to the subflow TCP socket.
      
      Patch 2 makes sure a TCP fallback socket returned to userspace by
      accept()ing on a MPTCP listening socket does not allow use of the
      "mptcp" TCP_ULP type. That ULP is intended only for use by in-kernel
      MPTCP subflows.
      
      Patch 3 fixes the possible deadlock when sending data and there are
      socket option changes to sync to the subflows.
      
      Patch 4 makes sure all MPTCP netlink event parameters are documented
      in the MPTCP uapi header.
      ====================
      
      Link: https://lore.kernel.org/r/20211214231604.211016-1-mathew.j.martineau@linux.intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      500f3720
    • Matthieu Baerts's avatar
      mptcp: add missing documented NL params · 6813b192
      Matthieu Baerts authored
      'loc_id' and 'rem_id' are set in all events linked to subflows but those
      were missing in the events description in the comments.
      
      Fixes: b911c97c ("mptcp: add netlink event support")
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6813b192
    • Maxim Galaganov's avatar
      mptcp: fix deadlock in __mptcp_push_pending() · 3d79e375
      Maxim Galaganov authored
      __mptcp_push_pending() may call mptcp_flush_join_list() with subflow
      socket lock held. If such call hits mptcp_sockopt_sync_all() then
      subsequently __mptcp_sockopt_sync() could try to lock the subflow
      socket for itself, causing a deadlock.
      
      sysrq: Show Blocked State
      task:ss-server       state:D stack:    0 pid:  938 ppid:     1 flags:0x00000000
      Call Trace:
       <TASK>
       __schedule+0x2d6/0x10c0
       ? __mod_memcg_state+0x4d/0x70
       ? csum_partial+0xd/0x20
       ? _raw_spin_lock_irqsave+0x26/0x50
       schedule+0x4e/0xc0
       __lock_sock+0x69/0x90
       ? do_wait_intr_irq+0xa0/0xa0
       __lock_sock_fast+0x35/0x50
       mptcp_sockopt_sync_all+0x38/0xc0
       __mptcp_push_pending+0x105/0x200
       mptcp_sendmsg+0x466/0x490
       sock_sendmsg+0x57/0x60
       __sys_sendto+0xf0/0x160
       ? do_wait_intr_irq+0xa0/0xa0
       ? fpregs_restore_userregs+0x12/0xd0
       __x64_sys_sendto+0x20/0x30
       do_syscall_64+0x38/0x90
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      RIP: 0033:0x7f9ba546c2d0
      RSP: 002b:00007ffdc3b762d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
      RAX: ffffffffffffffda RBX: 00007f9ba56c8060 RCX: 00007f9ba546c2d0
      RDX: 000000000000077a RSI: 0000000000e5e180 RDI: 0000000000000234
      RBP: 0000000000cc57f0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9ba56c8060
      R13: 0000000000b6ba60 R14: 0000000000cc7840 R15: 41d8685b1d7901b8
       </TASK>
      
      Fix the issue by using __mptcp_flush_join_list() instead of plain
      mptcp_flush_join_list() inside __mptcp_push_pending(), as suggested by
      Florian. The sockopt sync will be deferred to the workqueue.
      
      Fixes: 1b3e7ede ("mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY")
      Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/244Suggested-by: default avatarFlorian Westphal <fw@strlen.de>
      Reviewed-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMaxim Galaganov <max@internet.ru>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3d79e375
    • Florian Westphal's avatar
      mptcp: clear 'kern' flag from fallback sockets · d6692b3b
      Florian Westphal authored
      The mptcp ULP extension relies on sk->sk_sock_kern being set correctly:
      It prevents setsockopt(fd, IPPROTO_TCP, TCP_ULP, "mptcp", 6); from
      working for plain tcp sockets (any userspace-exposed socket).
      
      But in case of fallback, accept() can return a plain tcp sk.
      In such case, sk is still tagged as 'kernel' and setsockopt will work.
      
      This will crash the kernel, The subflow extension has a NULL ctx->conn
      mptcp socket:
      
      BUG: KASAN: null-ptr-deref in subflow_data_ready+0x181/0x2b0
      Call Trace:
       tcp_data_ready+0xf8/0x370
       [..]
      
      Fixes: cf7da0d6 ("mptcp: Create SUBFLOW socket for incoming connections")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d6692b3b
    • Florian Westphal's avatar
      mptcp: remove tcp ulp setsockopt support · 404cd9a2
      Florian Westphal authored
      TCP_ULP setsockopt cannot be used for mptcp because its already
      used internally to plumb subflow (tcp) sockets to the mptcp layer.
      
      syzbot managed to trigger a crash for mptcp connections that are
      in fallback mode:
      
      KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
      CPU: 1 PID: 1083 Comm: syz-executor.3 Not tainted 5.16.0-rc2-syzkaller #0
      RIP: 0010:tls_build_proto net/tls/tls_main.c:776 [inline]
      [..]
       __tcp_set_ulp net/ipv4/tcp_ulp.c:139 [inline]
       tcp_set_ulp+0x428/0x4c0 net/ipv4/tcp_ulp.c:160
       do_tcp_setsockopt+0x455/0x37c0 net/ipv4/tcp.c:3391
       mptcp_setsockopt+0x1b47/0x2400 net/mptcp/sockopt.c:638
      
      Remove support for TCP_ULP setsockopt.
      
      Fixes: d9e4c129 ("mptcp: only admit explicitly supported sockopt")
      Reported-by: syzbot+1fd9b69cde42967d1add@syzkaller.appspotmail.com
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      404cd9a2
  3. 14 Dec, 2021 20 commits