Skip to content
  1. Sep 22, 2022
    • Jonathan Toppins's avatar
      selftests: bonding: cause oops in bond_rr_gen_slave_id · 2ffd5732
      Jonathan Toppins authored
      
      
      This bonding selftest used to cause a kernel oops on aarch64
      and should be architectures agnostic.
      
      Signed-off-by: default avatarJonathan Toppins <jtoppins@redhat.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2ffd5732
    • Jonathan Toppins's avatar
      bonding: fix NULL deref in bond_rr_gen_slave_id · 0e400d60
      Jonathan Toppins authored
      Fix a NULL dereference of the struct bonding.rr_tx_counter member because
      if a bond is initially created with an initial mode != zero (Round Robin)
      the memory required for the counter is never created and when the mode is
      changed there is never any attempt to verify the memory is allocated upon
      switching modes.
      
      This causes the following Oops on an aarch64 machine:
          [  334.686773] Unable to handle kernel paging request at virtual address ffff2c91ac905000
          [  334.694703] Mem abort info:
          [  334.697486]   ESR = 0x0000000096000004
          [  334.701234]   EC = 0x25: DABT (current EL), IL = 32 bits
          [  334.706536]   SET = 0, FnV = 0
          [  334.709579]   EA = 0, S1PTW = 0
          [  334.712719]   FSC = 0x04: level 0 translation fault
          [  334.717586] Data abort info:
          [  334.720454]   ISV = 0, ISS = 0x00000004
          [  334.724288]   CM = 0, WnR = 0
          [  334.727244] swapper pgtable: 4k pages, 48-bit VAs, pgdp=000008044d662000
          [  334.733944] [ffff2c91ac905000] pgd=0000000000000000, p4d=0000000000000000
          [  334.740734] Internal error: Oops: 96000004 [#1] SMP
          [  334.745602] Modules linked in: bonding tls veth rfkill sunrpc arm_spe_pmu vfat fat acpi_ipmi ipmi_ssif ixgbe igb i40e mdio ipmi_devintf ipmi_msghandler arm_cmn arm_dsu_pmu cppc_cpufreq acpi_tad fuse zram crct10dif_ce ast ghash_ce sbsa_gwdt nvme drm_vram_helper drm_ttm_helper nvme_core ttm xgene_hwmon
          [  334.772217] CPU: 7 PID: 2214 Comm: ping Not tainted 6.0.0-rc4-00133-g64ae13ed4784 #4
          [  334.779950] Hardware name: GIGABYTE R272-P31-00/MP32-AR1-00, BIOS F18v (SCP: 1.08.20211002) 12/01/2021
          [  334.789244] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
          [  334.796196] pc : bond_rr_gen_slave_id+0x40/0x124 [bonding]
          [  334.801691] lr : bond_xmit_roundrobin_slave_get+0x38/0xdc [bonding]
          [  334.807962] sp : ffff8000221733e0
          [  334.811265] x29: ffff8000221733e0 x28: ffffdbac8572d198 x27: ffff80002217357c
          [  334.818392] x26: 000000000000002a x25: ffffdbacb33ee000 x24: ffff07ff980fa000
          [  334.825519] x23: ffffdbacb2e398ba x22: ffff07ff98102000 x21: ffff07ff981029c0
          [  334.832646] x20: 0000000000000001 x19: ffff07ff981029c0 x18: 0000000000000014
          [  334.839773] x17: 0000000000000000 x16: ffffdbacb1004364 x15: 0000aaaabe2f5a62
          [  334.846899] x14: ffff07ff8e55d968 x13: ffff07ff8e55db30 x12: 0000000000000000
          [  334.854026] x11: ffffdbacb21532e8 x10: 0000000000000001 x9 : ffffdbac857178ec
          [  334.861153] x8 : ffff07ff9f6e5a28 x7 : 0000000000000000 x6 : 000000007c2b3742
          [  334.868279] x5 : ffff2c91ac905000 x4 : ffff2c91ac905000 x3 : ffff07ff9f554400
          [  334.875406] x2 : ffff2c91ac905000 x1 : 0000000000000001 x0 : ffff07ff981029c0
          [  334.882532] Call trace:
          [  334.884967]  bond_rr_gen_slave_id+0x40/0x124 [bonding]
          [  334.890109]  bond_xmit_roundrobin_slave_get+0x38/0xdc [bonding]
          [  334.896033]  __bond_start_xmit+0x128/0x3a0 [bonding]
          [  334.901001]  bond_start_xmit+0x54/0xb0 [bonding]
          [  334.905622]  dev_hard_start_xmit+0xb4/0x220
          [  334.909798]  __dev_queue_xmit+0x1a0/0x720
          [  334.913799]  arp_xmit+0x3c/0xbc
          [  334.916932]  arp_send_dst+0x98/0xd0
          [  334.920410]  arp_solicit+0xe8/0x230
          [  334.923888]  neigh_probe+0x60/0xb0
          [  334.927279]  __neigh_event_send+0x3b0/0x470
          [  334.931453]  neigh_resolve_output+0x70/0x90
          [  334.935626]  ip_finish_output2+0x158/0x514
          [  334.939714]  __ip_finish_output+0xac/0x1a4
          [  334.943800]  ip_finish_output+0x40/0xfc
          [  334.947626]  ip_output+0xf8/0x1a4
          [  334.950931]  ip_send_skb+0x5c/0x100
          [  334.954410]  ip_push_pending_frames+0x3c/0x60
          [  334.958758]  raw_sendmsg+0x458/0x6d0
          [  334.962325]  inet_sendmsg+0x50/0x80
          [  334.965805]  sock_sendmsg+0x60/0x6c
          [  334.969286]  __sys_sendto+0xc8/0x134
          [  334.972853]  __arm64_sys_sendto+0x34/0x4c
          [  334.976854]  invoke_syscall+0x78/0x100
          [  334.980594]  el0_svc_common.constprop.0+0x4c/0xf4
          [  334.985287]  do_el0_svc+0x38/0x4c
          [  334.988591]  el0_svc+0x34/0x10c
          [  334.991724]  el0t_64_sync_handler+0x11c/0x150
          [  334.996072]  el0t_64_sync+0x190/0x194
          [  334.999726] Code: b9001062 f9403c02 d53cd044 8b040042 (b8210040)
          [  335.005810] ---[ end trace 0000000000000000 ]---
          [  335.010416] Kernel panic - not syncing: Oops: Fatal exception in interrupt
          [  335.017279] SMP: stopping secondary CPUs
          [  335.021374] Kernel Offset: 0x5baca8eb0000 from 0xffff800008000000
          [  335.027456] PHYS_OFFSET: 0x80000000
          [  335.030932] CPU features: 0x0000,0085c029,19805c82
          [  335.035713] Memory Limit: none
          [  335.038756] Rebooting in 180 seconds..
      
      The fix is to allocate the memory in bond_open() which is guaranteed
      to be called before any packets are processed.
      
      Fixes: 848ca918
      
       ("net: bonding: Use per-cpu rr_tx_counter")
      CC: Jussi Maki <joamaki@gmail.com>
      Signed-off-by: default avatarJonathan Toppins <jtoppins@redhat.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0e400d60
    • Michael Walle's avatar
      net: phy: micrel: fix shared interrupt on LAN8814 · 2002fbac
      Michael Walle authored
      Since commit ece19502 ("net: phy: micrel: 1588 support for LAN8814
      phy") the handler always returns IRQ_HANDLED, except in an error case.
      Before that commit, the interrupt status register was checked and if
      it was empty, IRQ_NONE was returned. Restore that behavior to play nice
      with the interrupt line being shared with others.
      
      Fixes: ece19502
      
       ("net: phy: micrel: 1588 support for LAN8814 phy")
      Signed-off-by: default avatarMichael Walle <michael@walle.cc>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Reviewed-by: default avatarDivya Koppera <Divya.Koppera@microchip.com>
      Link: https://lore.kernel.org/r/20220920141619.808117-1-michael@walle.cc
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2002fbac
    • Wen Gu's avatar
      net/smc: Stop the CLC flow if no link to map buffers on · e738455b
      Wen Gu authored
      There might be a potential race between SMC-R buffer map and
      link group termination.
      
      smc_smcr_terminate_all()     | smc_connect_rdma()
      --------------------------------------------------------------
                                   | smc_conn_create()
      for links in smcibdev        |
              schedule links down  |
                                   | smc_buf_create()
                                   |  \- smcr_buf_map_usable_links()
                                   |      \- no usable links found,
                                   |         (rmb->mr = NULL)
                                   |
                                   | smc_clc_send_confirm()
                                   |  \- access conn->rmb_desc->mr[]->rkey
                                   |     (panic)
      
      During reboot and IB device module remove, all links will be set
      down and no usable links remain in link groups. In such situation
      smcr_buf_map_usable_links() should return an error and stop the
      CLC flow accessing to uninitialized mr.
      
      Fixes: b9247544
      
       ("net/smc: convert static link ID instances to support multiple links")
      Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
      Link: https://lore.kernel.org/r/1663656189-32090-1-git-send-email-guwen@linux.alibaba.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e738455b
    • Jakub Kicinski's avatar
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 624aea6b
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2022-09-20 (ice)
      
      Michal re-sets TC configuration when changing number of queues.
      
      Mateusz moves the check and call for link-down-on-close to the specific
      path for downing/closing the interface.
      
      * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
        ice: Fix interface being down after reset with link-down-on-close flag on
        ice: config netdev tc before setting queues number
      ====================
      
      Link: https://lore.kernel.org/r/20220920205344.1860934-1-anthony.l.nguyen@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      624aea6b
    • Larysa Zaremba's avatar
      ice: Fix ice_xdp_xmit() when XDP TX queue number is not sufficient · 114f398d
      Larysa Zaremba authored
      The original patch added the static branch to handle the situation,
      when assigning an XDP TX queue to every CPU is not possible,
      so they have to be shared.
      
      However, in the XDP transmit handler ice_xdp_xmit(), an error was
      returned in such cases even before static condition was checked,
      thus making queue sharing still impossible.
      
      Fixes: 22bf877e
      
       ("ice: introduce XDP_TX fallback path")
      Signed-off-by: default avatarLarysa Zaremba <larysa.zaremba@intel.com>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Link: https://lore.kernel.org/r/20220919134346.25030-1-larysa.zaremba@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      114f398d
    • Jakub Kicinski's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · f64780e3
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2022-09-19 (iavf, i40e)
      
      Norbert adds checking of buffer size for Rx buffer checks in iavf.
      
      Michal corrects setting of max MTU in iavf to account for MTU data provided
      by PF, fixes i40e to set VF max MTU, and resolves lack of rate limiting
      when value was less than divisor for i40e.
      
      * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
        i40e: Fix set max_tx_rate when it is lower than 1 Mbps
        i40e: Fix VF set max MTU size
        iavf: Fix set max MTU size with port VLAN and jumbo frames
        iavf: Fix bad page state
      ====================
      
      Link: https://lore.kernel.org/r/20220919223428.572091-1-anthony.l.nguyen@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f64780e3
  2. Sep 21, 2022
  3. Sep 20, 2022
    • Tetsuo Handa's avatar
      net: clear msg_get_inq in __get_compat_msghdr() · d547c1b7
      Tetsuo Handa authored
      syzbot is still complaining uninit-value in tcp_recvmsg(), for
      commit 1228b34c
      
       ("net: clear msg_get_inq in __sys_recvfrom() and
      __copy_msghdr_from_user()") missed that __get_compat_msghdr() is called
      instead of copy_msghdr_from_user() when MSG_CMSG_COMPAT is specified.
      
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Fixes: 1228b34c
      
       ("net: clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user()")
      Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/r/d06d0f7f-696c-83b4-b2d5-70b5f2730a37@I-love.SAKURA.ne.jp
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d547c1b7
    • Jakub Kicinski's avatar
      Merge branch 'ipmr-always-call-ip-6-_mr_forward-from-rcu-read-side-critical-section' · 68fe503c
      Jakub Kicinski authored
      Ido Schimmel says:
      
      ====================
      ipmr: Always call ip{,6}_mr_forward() from RCU read-side critical section
      
      Patch #1 fixes a bug in ipmr code.
      
      Patch #2 adds corresponding test cases.
      ====================
      
      Link: https://lore.kernel.org/r/20220914075339.4074096-1-idosch@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      68fe503c
    • Ido Schimmel's avatar
      selftests: forwarding: Add test cases for unresolved multicast routes · 2b5a8c8f
      Ido Schimmel authored
      
      
      Add IPv4 and IPv6 test cases for unresolved multicast routes, testing
      that queued packets are forwarded after installing a matching (S, G)
      route.
      
      The test cases can be used to reproduce the bugs fixed in "ipmr: Always
      call ip{,6}_mr_forward() from RCU read-side critical section".
      
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2b5a8c8f
    • Ido Schimmel's avatar
      ipmr: Always call ip{,6}_mr_forward() from RCU read-side critical section · b07a9b26
      Ido Schimmel authored
      These functions expect to be called from RCU read-side critical section,
      but this only happens when invoked from the data path via
      ip{,6}_mr_input(). They can also be invoked from process context in
      response to user space adding a multicast route which resolves a cache
      entry with queued packets [1][2].
      
      Fix by adding missing rcu_read_lock() / rcu_read_unlock() in these call
      paths.
      
      [1]
      WARNING: suspicious RCU usage
      6.0.0-rc3-custom-15969-g049d233c8bcc-dirty #1387 Not tainted
      -----------------------------
      net/ipv4/ipmr.c:84 suspicious rcu_dereference_check() usage!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 2, debug_locks = 1
      1 lock held by smcrouted/246:
       #0: ffffffff862389b0 (rtnl_mutex){+.+.}-{3:3}, at: ip_mroute_setsockopt+0x11c/0x1420
      
      stack backtrace:
      CPU: 0 PID: 246 Comm: smcrouted Not tainted 6.0.0-rc3-custom-15969-g049d233c8bcc-dirty #1387
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0x91/0xb9
       vif_dev_read+0xbf/0xd0
       ipmr_queue_xmit+0x135/0x1ab0
       ip_mr_forward+0xe7b/0x13d0
       ipmr_mfc_add+0x1a06/0x2ad0
       ip_mroute_setsockopt+0x5c1/0x1420
       do_ip_setsockopt+0x23d/0x37f0
       ip_setsockopt+0x56/0x80
       raw_setsockopt+0x219/0x290
       __sys_setsockopt+0x236/0x4d0
       __x64_sys_setsockopt+0xbe/0x160
       do_syscall_64+0x34/0x80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      [2]
      WARNING: suspicious RCU usage
      6.0.0-rc3-custom-15969-g049d233c8bcc-dirty #1387 Not tainted
      -----------------------------
      net/ipv6/ip6mr.c:69 suspicious rcu_dereference_check() usage!
      
      other info that might help us debug this:
      
      rcu_scheduler_active = 2, debug_locks = 1
      1 lock held by smcrouted/246:
       #0: ffffffff862389b0 (rtnl_mutex){+.+.}-{3:3}, at: ip6_mroute_setsockopt+0x6b9/0x2630
      
      stack backtrace:
      CPU: 1 PID: 246 Comm: smcrouted Not tainted 6.0.0-rc3-custom-15969-g049d233c8bcc-dirty #1387
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
      Call Trace:
       <TASK>
       dump_stack_lvl+0x91/0xb9
       vif_dev_read+0xbf/0xd0
       ip6mr_forward2.isra.0+0xc9/0x1160
       ip6_mr_forward+0xef0/0x13f0
       ip6mr_mfc_add+0x1ff2/0x31f0
       ip6_mroute_setsockopt+0x1825/0x2630
       do_ipv6_setsockopt+0x462/0x4440
       ipv6_setsockopt+0x105/0x140
       rawv6_setsockopt+0xd8/0x690
       __sys_setsockopt+0x236/0x4d0
       __x64_sys_setsockopt+0xbe/0x160
       do_syscall_64+0x34/0x80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      Fixes: ebc31979
      
       ("ipmr: add rcu protection over (struct vif_device)->dev")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b07a9b26
    • Alex Elder's avatar
      net: ipa: properly limit modem routing table use · cf412ec3
      Alex Elder authored
      IPA can route packets between IPA-connected entities.  The AP and
      modem are currently the only such entities supported, and no routing
      is required to transfer packets between them.
      
      The number of entries in each routing table is fixed, and defined at
      initialization time.  Some of these entries are designated for use
      by the modem, and the rest are available for the AP to use.  The AP
      sends a QMI message to the modem which describes (among other
      things) information about routing table memory available for the
      modem to use.
      
      Currently the QMI initialization packet gives wrong information in
      its description of routing tables.  What *should* be supplied is the
      maximum index that the modem can use for the routing table memory
      located at a given location.  The current code instead supplies the
      total *number* of routing table entries.  Furthermore, the modem is
      granted the entire table, not just the subset it's supposed to use.
      
      This patch fixes this.  First, the ipa_mem_bounds structure is
      generalized so its "end" field can be interpreted either as a final
      byte offset, or a final array index.  Second, the IPv4 and IPv6
      (non-hashed and hashed) table information fields in the QMI
      ipa_init_modem_driver_req structure are changed to be ipa_mem_bounds
      rather than ipa_mem_array structures.  Third, we set the "end" value
      for each routing table to be the last index, rather than setting the
      "count" to be the number of indices.  Finally, instead of allowing
      the modem to use all of a routing table's memory, it is limited to
      just the portion meant to be used by the modem.  In all versions of
      IPA currently supported, that is IPA_ROUTE_MODEM_COUNT (8) entries.
      
      Update a few comments for clarity.
      
      Fixes: 530f9216
      
       ("soc: qcom: ipa: AP/modem communications")
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Link: https://lore.kernel.org/r/20220913204602.1803004-1-elder@linaro.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cf412ec3