Skip to content
  1. Jul 23, 2021
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 9f42f674
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "A pair of arm64 fixes for -rc3. The straightforward one is a fix to
        our firmware calling stub, which accidentally started corrupting the
        link register on machines with SVE. Since these machines don't really
        exist yet, it wasn't spotted in -next.
      
        The other fix is a revert-and-a-bit of a patch originally intended to
        allow PTE-level huge mappings for the VMAP area on 32-bit PPC 8xx. A
        side-effect of this change was that our pXd_set_huge() implementations
        could be replaced with generic dummy functions depending on the levels
        of page-table being used, which in turn broke the boot if we fail to
        create the linear mapping as a result of using these functions to
        operate on the pgd. Huge thanks to Michael Ellerman for modifying the
        revert so as not to regress PPC 8xx in terms of functionality.
      
        Anyway, that's the background and it's also available in the commit
        message along with Link tags pointing at all of the fun.
      
        Summary:
      
         - Fix hang when issuing SMC on SVE-capable system due to
           clobbered LR
      
         - Fix boot failure due to missing block mappings with folded
           page-table"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        Revert "mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge"
        arm64: smccc: Save lr before calling __arm_smccc_sve_check()
      9f42f674
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20210722' of... · 7c14e4d6
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20210722' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv fixes from Wei Liu:
      
       - bug fix from Haiyang for vmbus CPU assignment
      
       - revert of a bogus patch that went into 5.14-rc1
      
      * tag 'hyperv-fixes-signed-20210722' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        Revert "x86/hyperv: fix logical processor creation"
        Drivers: hv: vmbus: Fix duplicate CPU assignments within a device
      7c14e4d6
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 4784dc99
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix type of bind option flag in af_xdp, from Baruch Siach.
      
       2) Fix use after free in bpf_xdp_link_release(), from Xuan Zhao.
      
       3) PM refcnt imbakance in r8152, from Takashi Iwai.
      
       4) Sign extension ug in liquidio, from Colin Ian King.
      
       5) Mising range check in s390 bpf jit, from Colin Ian King.
      
       6) Uninit value in caif_seqpkt_sendmsg(), from Ziyong Xuan.
      
       7) Fix skb page recycling race, from Ilias Apalodimas.
      
       8) Fix memory leak in tcindex_partial_destroy_work, from Pave Skripkin.
      
       9) netrom timer sk refcnt issues, from Nguyen Dinh Phi.
      
      10) Fix data races aroun tcp's tfo_active_disable_stamp, from Eric
          Dumazet.
      
      11) act_skbmod should only operate on ethernet packets, from Peilin Ye.
      
      12) Fix slab out-of-bpunds in fib6_nh_flush_exceptions(),, from Psolo
          Abeni.
      
      13) Fix sparx5 dependencies, from Yajun Deng.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (74 commits)
        dpaa2-switch: seed the buffer pool after allocating the swp
        net: sched: cls_api: Fix the the wrong parameter
        net: sparx5: fix unmet dependencies warning
        net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum
        net: dsa: ensure linearized SKBs in case of tail taggers
        ravb: Remove extra TAB
        ravb: Fix a typo in comment
        net: dsa: sja1105: make VID 4095 a bridge VLAN too
        tcp: disable TFO blackhole logic by default
        sctp: do not update transport pathmtu if SPP_PMTUD_ENABLE is not set
        net: ixp46x: fix ptp build failure
        ibmvnic: Remove the proper scrq flush
        selftests: net: add ESP-in-UDP PMTU test
        udp: check encap socket in __udp_lib_err
        sctp: update active_key for asoc when old key is being replaced
        r8169: Avoid duplicate sysfs entry creation error
        ixgbe: Fix packet corruption due to missing DMA sync
        Revert "qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()"
        ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions
        fsl/fman: Add fibre support
        ...
      4784dc99
    • Linus Torvalds's avatar
      Merge tag 'mmc-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 5e09e197
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
      
       - Use kref to fix KASAN splats triggered during card removal
      
       - Don't allocate IDA for OF aliases
      
      * tag 'mmc-v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: core: Don't allocate IDA for OF aliases
        mmc: core: Use kref in place of struct mmc_blk_data::usage
      5e09e197
  2. Jul 22, 2021
    • Ioana Ciornei's avatar
      dpaa2-switch: seed the buffer pool after allocating the swp · 7aaa0f31
      Ioana Ciornei authored
      Any interraction with the buffer pool (seeding a buffer, acquire one) is
      made through a software portal (SWP, a DPIO object).
      There are circumstances where the dpaa2-switch driver probes on a DPSW
      before any DPIO devices have been probed. In this case, seeding of the
      buffer pool will lead to a panic since no SWPs are initialized.
      
      To fix this, seed the buffer pool after making sure that the software
      portals have been probed and are ready to be used.
      
      Fixes: 0b1b7137
      
       ("staging: dpaa2-switch: handle Rx path on control interface")
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7aaa0f31
    • Yajun Deng's avatar
      net: sched: cls_api: Fix the the wrong parameter · 9d85a6f4
      Yajun Deng authored
      The 4th parameter in tc_chain_notify() should be flags rather than seq.
      Let's change it back correctly.
      
      Fixes: 32a4f5ec
      
       ("net: sched: introduce chain object to uapi")
      Signed-off-by: default avatarYajun Deng <yajun.deng@linux.dev>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d85a6f4
    • Randy Dunlap's avatar
      net: sparx5: fix unmet dependencies warning · 98c5b13f
      Randy Dunlap authored
      
      
      WARNING: unmet direct dependencies detected for PHY_SPARX5_SERDES
        Depends on [n]: (ARCH_SPARX5 || COMPILE_TEST [=n]) && OF [=y] && HAS_IOMEM [=y]
        Selected by [y]:
        - SPARX5_SWITCH [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_MICROCHIP [=y] && NET_SWITCHDEV [=y] && HAS_IOMEM [=y] && OF [=y]
      
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Lars Povlsen <lars.povlsen@microchip.com>
      Cc: Steen Hegelund <Steen.Hegelund@microchip.com>
      Cc: UNGLinuxDriver@microchip.com
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      98c5b13f
    • David S. Miller's avatar
      Merge branch 'ksz-dsa-fixes' · 5ca096db
      David S. Miller authored
      
      
      Lino Sanfilippo says:
      
      ====================
      Fixes for KSZ DSA switch
      
      These patches fix issues I encountered while using a KSZ9897 as a DSA
      switch with a broadcom GENET network device as the DSA master device.
      
      PATCH 1 fixes an invalid access to an SKB in case it is scattered.
      PATCH 2 fixes incorrect hardware checksum calculation caused by the DSA
      tag.
      
      Changes in v2:
      - instead of linearizing the SKBs only for KSZ switches ensure linearized
        SKBs for all tail taggers by clearing the feature flags NETIF_F_HW_SG and
        NETIF_F_FRAGLIST (suggested by Vladimir Oltean)
      
      The patches have been tested with a KSZ9897 and apply against net-next.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ca096db
    • Lino Sanfilippo's avatar
      net: dsa: tag_ksz: dont let the hardware process the layer 4 checksum · 37120f23
      Lino Sanfilippo authored
      
      
      If the checksum calculation is offloaded to the network device (e.g due to
      NETIF_F_HW_CSUM inherited from the DSA master device), the calculated
      layer 4 checksum is incorrect. This is since the DSA tag which is placed
      after the layer 4 data is considered as being part of the daa and thus
      errorneously included into the checksum calculation.
      To avoid this, always calculate the layer 4 checksum in software.
      
      Signed-off-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37120f23
    • Lino Sanfilippo's avatar
      net: dsa: ensure linearized SKBs in case of tail taggers · 21cf377a
      Lino Sanfilippo authored
      
      
      The function skb_put() that is used by tail taggers to make room for the
      DSA tag must only be called for linearized SKBS. However in case that the
      slave device inherited features like NETIF_F_HW_SG or NETIF_F_FRAGLIST the
      SKB passed to the slaves transmit function may not be linearized.
      Avoid those SKBs by clearing the NETIF_F_HW_SG and NETIF_F_FRAGLIST flags
      for tail taggers.
      Furthermore since the tagging protocol can be changed at runtime move the
      code for setting up the slaves features into dsa_slave_setup_tagger().
      
      Suggested-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      21cf377a
    • Biju Das's avatar
      ravb: Remove extra TAB · 9f061b9a
      Biju Das authored
      
      
      Align the member description comments for struct ravb_desc by
      removing the extra TAB.
      
      Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
      Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f061b9a
    • Biju Das's avatar
      ravb: Fix a typo in comment · 291d0a2c
      Biju Das authored
      
      
      Fix the typo RX->TX in comment, as the code following the comment
      process TX and not RX.
      
      Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
      Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      291d0a2c
    • Vladimir Oltean's avatar
      net: dsa: sja1105: make VID 4095 a bridge VLAN too · e40cba94
      Vladimir Oltean authored
      This simple series of commands:
      
      ip link add br0 type bridge vlan_filtering 1
      ip link set swp0 master br0
      
      fails on sja1105 with the following error:
      [   33.439103] sja1105 spi0.1: vlan-lookup-table needs to have at least the default untagged VLAN
      [   33.447710] sja1105 spi0.1: Invalid config, cannot upload
      Warning: sja1105: Failed to change VLAN Ethertype.
      
      For context, sja1105 has 3 operating modes:
      - SJA1105_VLAN_UNAWARE: the dsa_8021q_vlans are committed to hardware
      - SJA1105_VLAN_FILTERING_FULL: the bridge_vlans are committed to hardware
      - SJA1105_VLAN_FILTERING_BEST_EFFORT: both the dsa_8021q_vlans and the
        bridge_vlans are committed to hardware
      
      Swapping out a VLAN list and another in happens in
      sja1105_build_vlan_table(), which performs a delta update procedure.
      That function is called from a few places, notably from
      sja1105_vlan_filtering() which is called from the
      SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING handler.
      
      The above set of 2 commands fails when run on a kernel pre-commit
      8841f6e6 ("net: dsa: sja1105: make devlink property
      best_effort_vlan_filtering true by default"). So the priv->vlan_state
      transition that takes place is between VLAN-unaware and full VLAN
      filtering. So the dsa_8021q_vlans are swapped out and the bridge_vlans
      are swapped in.
      
      So why does it fail?
      
      Well, the bridge driver, through nbp_vlan_init(), first sets up the
      SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING attribute, and only then
      proceeds to call nbp_vlan_add for the default_pvid.
      
      So when we swap out the dsa_8021q_vlans and swap in the bridge_vlans in
      the SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING handler, there are no bridge
      VLANs (yet). So we have wiped the VLAN table clean, and the low-level
      static config checker complains of an invalid configuration. We _will_
      add the bridge VLANs using the dynamic config interface, albeit later,
      when nbp_vlan_add() calls us. So it is natural that it fails.
      
      So why did it ever work?
      
      Surprisingly, it looks like I only tested this configuration with 2
      things set up in a particular way:
      - a network manager that brings all ports up
      - a kernel with CONFIG_VLAN_8021Q=y
      
      It is widely known that commit ad1afb00 ("vlan_dev: VLAN 0 should be
      treated as "no vlan tag" (802.1p packet)") installs VID 0 to every net
      device that comes up. DSA treats these VLANs as bridge VLANs, and
      therefore, in my testing, the list of bridge_vlans was never empty.
      
      However, if CONFIG_VLAN_8021Q is not enabled, or the port is not up when
      it joins a VLAN-aware bridge, the bridge_vlans list will be temporarily
      empty, and the sja1105_static_config_reload() call from
      sja1105_vlan_filtering() will fail.
      
      To fix this, the simplest thing is to keep VID 4095, the one used for
      CPU-injected control packets since commit ed040abc ("net: dsa:
      sja1105: use 4095 as the private VLAN for untagged traffic"), in the
      list of bridge VLANs too, not just the list of tag_8021q VLANs. This
      ensures that the list of bridge VLANs will never be empty.
      
      Fixes: ec5ae610
      
       ("net: dsa: sja1105: save/restore VLANs using a delta commit method")
      Reported-by: default avatarRadu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e40cba94
    • Wei Wang's avatar
      tcp: disable TFO blackhole logic by default · 213ad73d
      Wei Wang authored
      Multiple complaints have been raised from the TFO users on the internet
      stating that the TFO blackhole logic is too aggressive and gets falsely
      triggered too often.
      (e.g. https://blog.apnic.net/2021/07/05/tcp-fast-open-not-so-fast/)
      Considering that most middleboxes no longer drop TFO packets, we decide
      to disable the blackhole logic by setting
      /proc/sys/net/ipv4/tcp_fastopen_blackhole_timeout_set to 0 by default.
      
      Fixes: cf1ef3f0
      
       ("net/tcp_fastopen: Disable active side TFO in certain scenarios")
      Signed-off-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      213ad73d
    • Xin Long's avatar
      sctp: do not update transport pathmtu if SPP_PMTUD_ENABLE is not set · 02dc2ee7
      Xin Long authored
      Currently, in sctp_packet_config(), sctp_transport_pmtu_check() is
      called to update transport pathmtu with dst's mtu when dst's mtu
      has been changed by non sctp stack like xfrm.
      
      However, this should only happen when SPP_PMTUD_ENABLE is set, no
      matter where dst's mtu changed. This patch is to fix by checking
      SPP_PMTUD_ENABLE flag before calling sctp_transport_pmtu_check().
      
      Thanks Jacek for reporting and looking into this issue.
      
      v1->v2:
        - add the missing "{" to fix the build error.
      
      Fixes: 69fec325
      
       ('Revert "sctp: remove sctp_transport_pmtu_check"')
      Reported-by: default avatarJacek Szafraniec <jacek.szafraniec@nokia.com>
      Tested-by: default avatarJacek Szafraniec <jacek.szafraniec@nokia.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      02dc2ee7
    • Linus Torvalds's avatar
      Merge tag 's390-5.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 3d5895cd
      Linus Torvalds authored
      Pull s390 updates from Heiko Carstens:
      
       - fix / add expoline usage in "DMA" code
      
       - fix compat vdso Makefile to avoid permanent rebuild
      
       - fix ftrace_update_ftrace_func to avoid NULL pointer dereference
      
       - update defconfigs
      
       - trivial coding style fix
      
      * tag 's390-5.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: update defconfigs
        s390/cpumf: fix semicolon.cocci warnings
        s390/boot: fix use of expolines in the DMA code
        s390/ftrace: fix ftrace_update_ftrace_func implementation
        s390/defconfig: allow early device mapper disks
        s390/vdso32: add vdso32.lds to targets
      3d5895cd
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 7b6ae471
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A collection of driver specific fixes, there was a bit of a kerfuffle
        with some last minute review on hte spi-cadence-quadspi division by
        zero change but otherwise nothing terribly remarkable here - important
        fixes if you have the hardware but nothing with too wide an impact"
      
      * tag 'spi-fix-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: spi-bcm2835: Fix deadlock
        spi: cadence: Correct initialisation of runtime PM again
        spi: cadence-quadspi: Disable Auto-HW polling
        spi: spi-cadence-quadspi: Fix division by zero warning
        spi: spi-cadence-quadspi: Revert "Fix division by zero warning"
        spi: spi-cadence-quadspi: Fix division by zero warning
        spi: mediatek: move devm_spi_register_master position
        spi: mediatek: fix fifo rx mode
        spi: atmel: Fix CS and initialization bug
        spi: stm32: fixes pm_runtime calls in probe/remove
        spi: imx: mx51-ecspi: Reinstate low-speed CONFIGREG delay
        spi: stm32h7: fix full duplex irq handler handling
      7b6ae471
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v5.14-rc2' of... · 7c3d49b0
      Linus Torvalds authored
      Merge tag 'regulator-fix-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
      
      Pull regulator fixes from Mark Brown:
       "A few driver specific fixes that came in since the merge window, plus
        a change to mark the regulator-fixed-domain DT binding as deprecated
        in order to try to to discourage any new users while a better solution
        is put in place"
      
      * tag 'regulator-fix-v5.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: hi6421: Fix getting wrong drvdata
        regulator: mtk-dvfsrc: Fix wrong dev pointer for devm_regulator_register
        regulator: fixed: Mark regulator-fixed-domain as deprecated
        regulator: bd9576: Fix testing wrong flag in check_temp_flag_mismatch
        regulator: hi6421v600: Fix getting wrong drvdata that causes boot failure
        regulator: rt5033: Fix n_voltages settings for BUCK and LDO
        regulator: rtmv20: Fix wrong mask for strobe-polarity-high
      7c3d49b0
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-20210721' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · b4e62aaf
      Linus Torvalds authored
      Pull AFS fixes from David Howells:
      
       - Fix a tracepoint that causes one of the tracing subsystem query files
         to crash if the module is loaded
      
       - Fix afs_writepages() to take account of whether the storage rpc
         actually succeeded when updating the cyclic writeback counter
      
       - Fix some error code propagation/handling
      
       - Fix place where afs_writepages() was setting writeback_index to a
         file position rather than a page index
      
      * tag 'afs-fixes-20210721' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Remove redundant assignment to ret
        afs: Fix setting of writeback_index
        afs: check function return
        afs: Fix tracepoint string placement with built-in AFS
      b4e62aaf
    • Arnd Bergmann's avatar
      net: ixp46x: fix ptp build failure · 161dcc02
      Arnd Bergmann authored
      The rework of the ixp46x cpu detection left the network driver in
      a half broken state:
      
      drivers/net/ethernet/xscale/ptp_ixp46x.c: In function 'ptp_ixp_init':
      drivers/net/ethernet/xscale/ptp_ixp46x.c:290:51: error: 'IXP4XX_TIMESYNC_BASE_VIRT' undeclared (first use in this function)
        290 |                 (struct ixp46x_ts_regs __iomem *) IXP4XX_TIMESYNC_BASE_VIRT;
            |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/xscale/ptp_ixp46x.c:290:51: note: each undeclared identifier is reported only once for each function it appears in
      drivers/net/ethernet/xscale/ptp_ixp46x.c: At top level:
      drivers/net/ethernet/xscale/ptp_ixp46x.c:323:1: error: data definition has no type or storage class [-Werror]
        323 | module_init(ptp_ixp_init);
      
      I have patches to complete the transition for a future release, but
      for the moment, add the missing include statements to get it to build
      again.
      
      Fixes: 09aa9aab
      
       ("soc: ixp4xx: move cpu detection to linux/soc/ixp4xx/cpu.h")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      161dcc02
  3. Jul 21, 2021
    • Sukadev Bhattiprolu's avatar
      ibmvnic: Remove the proper scrq flush · bb55362b
      Sukadev Bhattiprolu authored
      Commit 65d6470d ("ibmvnic: clean pending indirect buffs during reset")
      intended to remove the call to ibmvnic_tx_scrq_flush() when the
      ->resetting flag is true and was tested that way. But during the final
      rebase to net-next, the hunk got applied to a block few lines below
      (which happened to have the same diff context) and the wrong call to
      ibmvnic_tx_scrq_flush() got removed.
      
      Fix that by removing the correct ibmvnic_tx_scrq_flush() and restoring
      the one that was incorrectly removed.
      
      Fixes: 65d6470d
      
       ("ibmvnic: clean pending indirect buffs during reset")
      Reported-by: default avatarDany Madden <drt@linux.ibm.com>
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb55362b
    • Wei Liu's avatar
      Revert "x86/hyperv: fix logical processor creation" · f5a11c69
      Wei Liu authored
      This reverts commit 450605c2
      
      .
      
      Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
      f5a11c69
    • David S. Miller's avatar
      Merge branch 'pmtu-esp' · 3ddaed6b
      David S. Miller authored
      
      
      Vadim Fedorenko ays:
      
      ====================
      Fix PMTU for ESP-in-UDP encapsulation
      
      Bug 213669 uncovered regression in PMTU discovery for UDP-encapsulated
      routes and some incorrect usage in udp tunnel fields. This series fixes
      problems and also adds such case for selftests
      
      v3:
       - update checking logic to account SCTP use case
      v2:
       - remove refactor code that was in first patch
       - move checking logic to __udp{4,6}_lib_err_encap
       - add more tests, especially routed configuration
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ddaed6b
    • Vadim Fedorenko's avatar
      selftests: net: add ESP-in-UDP PMTU test · ece1278a
      Vadim Fedorenko authored
      
      
      The case of ESP in UDP encapsulation was not covered before. Add
      cases of local changes of MTU and difference on routed path.
      
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ece1278a
    • Vadim Fedorenko's avatar
      udp: check encap socket in __udp_lib_err · 9bfce73c
      Vadim Fedorenko authored
      Commit d26796ae ("udp: check udp sock encap_type in __udp_lib_err")
      added checks for encapsulated sockets but it broke cases when there is
      no implementation of encap_err_lookup for encapsulation, i.e. ESP in
      UDP encapsulation. Fix it by calling encap_err_lookup only if socket
      implements this method otherwise treat it as legal socket.
      
      Fixes: d26796ae
      
       ("udp: check udp sock encap_type in __udp_lib_err")
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9bfce73c
    • Xin Long's avatar
      sctp: update active_key for asoc when old key is being replaced · 58acd100
      Xin Long authored
      syzbot reported a call trace:
      
        BUG: KASAN: use-after-free in sctp_auth_shkey_hold+0x22/0xa0 net/sctp/auth.c:112
        Call Trace:
         sctp_auth_shkey_hold+0x22/0xa0 net/sctp/auth.c:112
         sctp_set_owner_w net/sctp/socket.c:131 [inline]
         sctp_sendmsg_to_asoc+0x152e/0x2180 net/sctp/socket.c:1865
         sctp_sendmsg+0x103b/0x1d30 net/sctp/socket.c:2027
         inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:821
         sock_sendmsg_nosec net/socket.c:703 [inline]
         sock_sendmsg+0xcf/0x120 net/socket.c:723
      
      This is an use-after-free issue caused by not updating asoc->shkey after
      it was replaced in the key list asoc->endpoint_shared_keys, and the old
      key was freed.
      
      This patch is to fix by also updating active_key for asoc when old key is
      being replaced with a new one. Note that this issue doesn't exist in
      sctp_auth_del_key_id(), as it's not allowed to delete the active_key
      from the asoc.
      
      Fixes: 1b1e0bc9
      
       ("sctp: add refcnt support for sh_key")
      Reported-by: default avatar <syzbot+b774577370208727d12b@syzkaller.appspotmail.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58acd100
    • Sayanta Pattanayak's avatar
      r8169: Avoid duplicate sysfs entry creation error · e9a72f87
      Sayanta Pattanayak authored
      When registering the MDIO bus for a r8169 device, we use the PCI
      bus/device specifier as a (seemingly) unique device identifier.
      However the very same BDF number can be used on another PCI segment,
      which makes the driver fail probing:
      
      [ 27.544136] r8169 0002:07:00.0: enabling device (0000 -> 0003)
      [ 27.559734] sysfs: cannot create duplicate filename '/class/mdio_bus/r8169-700'
      ....
      [ 27.684858] libphy: mii_bus r8169-700 failed to register
      [ 27.695602] r8169: probe of 0002:07:00.0 failed with error -22
      
      Add the segment number to the device name to make it more unique.
      
      This fixes operation on ARM N1SDP boards, with two boards connected
      together to form an SMP system, and all on-board devices showing up
      twice, just on different PCI segments. A similar issue would occur on
      large systems with many PCI slots and multiple RTL8169 NICs.
      
      Fixes: f1e911d5
      
       ("r8169: add basic phylib support")
      Signed-off-by: default avatarSayanta Pattanayak <sayanta.pattanayak@arm.com>
      [Andre: expand commit message, use pci_domain_nr()]
      Signed-off-by: default avatarAndre Przywara <andre.przywara@arm.com>
      Acked-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9a72f87
    • Jiapeng Chong's avatar
      afs: Remove redundant assignment to ret · b4280812
      Jiapeng Chong authored
      Variable ret is set to -ENOENT and -ENOMEM but this value is never
      read as it is overwritten or not used later on, hence it is a
      redundant assignment and can be removed.
      
      Cleans up the following clang-analyzer warning:
      
      fs/afs/dir.c:2014:4: warning: Value stored to 'ret' is never read
      [clang-analyzer-deadcode.DeadStores].
      
      fs/afs/dir.c:659:2: warning: Value stored to 'ret' is never read
      [clang-analyzer-deadcode.DeadStores].
      
      [DH made the following modifications:
      
       - In afs_rename(), -ENOMEM should be placed in op->error instead of ret,
         rather than the assignment being removed entirely.  afs_put_operation()
         will pick it up from there and return it.
      
       - If afs_sillyrename() fails, its error code should be placed in op->error
         rather than in ret also.
      ]
      
      Fixes: e49c7b2f
      
       ("afs: Build an abstraction around an "operation" concept")
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Signed-off-by: default avatarJiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/1619691492-83866-1-git-send-email-jiapeng.chong@linux.alibaba.com
      Link: https://lore.kernel.org/r/162609465444.3133237.7562832521724298900.stgit@warthog.procyon.org.uk/ # v1
      Link: https://lore.kernel.org/r/162610729052.3408253.17364333638838151299.stgit@warthog.procyon.org.uk/ # v2
      b4280812
    • David Howells's avatar
      afs: Fix setting of writeback_index · 5a972474
      David Howells authored
      Fix afs_writepages() to always set mapping->writeback_index to a page index
      and not a byte position[1].
      
      Fixes: 31143d5d
      
       ("AFS: implement basic file write support")
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/CAB9dFdvHsLsw7CMnB+4cgciWDSqVjuij4mH3TaXnHQB8sz5rHw@mail.gmail.com/ [1]
      Link: https://lore.kernel.org/r/162610728339.3408253.4604750166391496546.stgit@warthog.procyon.org.uk/ # v2 (no v1)
      5a972474
    • Tom Rix's avatar
      afs: check function return · afe69498
      Tom Rix authored
      Static analysis reports this problem
      
      write.c:773:29: warning: Assigned value is garbage or undefined
        mapping->writeback_index = next;
                                 ^ ~~~~
      The call to afs_writepages_region() can return without setting
      next.  So check the function return before using next.
      
      Changes:
       ver #2:
         - Need to fix the range_cyclic case also[1].
      
      Fixes: e87b03f5
      
       ("afs: Prepare for use of THPs")
      Signed-off-by: default avatarTom Rix <trix@redhat.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/20210430155031.3287870-1-trix@redhat.com
      Link: https://lore.kernel.org/r/CAB9dFdvHsLsw7CMnB+4cgciWDSqVjuij4mH3TaXnHQB8sz5rHw@mail.gmail.com/ [1]
      Link: https://lore.kernel.org/r/162609464716.3133237.10354897554363093252.stgit@warthog.procyon.org.uk/ # v1
      Link: https://lore.kernel.org/r/162610727640.3408253.8687445613469681311.stgit@warthog.procyon.org.uk/ # v2
      afe69498
    • David Howells's avatar
      afs: Fix tracepoint string placement with built-in AFS · 6c881ca0
      David Howells authored
      To quote Alexey[1]:
      
          I was adding custom tracepoint to the kernel, grabbed full F34 kernel
          .config, disabled modules and booted whole shebang as VM kernel.
      
          Then did
      
      	perf record -a -e ...
      
          It crashed:
      
      	general protection fault, probably for non-canonical address 0x435f5346592e4243: 0000 [#1] SMP PTI
      	CPU: 1 PID: 842 Comm: cat Not tainted 5.12.6+ #26
      	Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014
      	RIP: 0010:t_show+0x22/0xd0
      
          Then reproducer was narrowed to
      
      	# cat /sys/kernel/tracing/printk_formats
      
          Original F34 kernel with modules didn't crash.
      
          So I started to disable options and after disabling AFS everything
          started working again.
      
          The root cause is that AFS was placing char arrays content into a
          section full of _pointers_ to strings with predictable consequences.
      
          Non canonical address 435f5346592e4243 is "CB.YFS_" which came from
          CM_NAME macro.
      
          Steps to reproduce:
      
      	CONFIG_AFS=y
      	CONFIG_TRACING=y
      
      	# cat /sys/kernel/tracing/printk_formats
      
      Fix this by the following means:
      
       (1) Add enum->string translation tables in the event header with the AFS
           and YFS cache/callback manager operations listed by RPC operation ID.
      
       (2) Modify the afs_cb_call tracepoint to print the string from the
           translation table rather than using the string at the afs_call name
           pointer.
      
       (3) Switch translation table depending on the service we're being accessed
           as (AFS or YFS) in the tracepoint print clause.  Will this cause
           problems to userspace utilities?
      
           Note that the symbolic representation of the YFS service ID isn't
           available to this header, so I've put it in as a number.  I'm not sure
           if this is the best way to do this.
      
       (4) Remove the name wrangling (CM_NAME) macro and put the names directly
           into the afs_call_type structs in cmservice.c.
      
      Fixes: 8e8d7f13
      
       ("afs: Add some tracepoints")
      Reported-by: default avatarAlexey Dobriyan (SK hynix) <adobriyan@gmail.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      Reviewed-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      cc: Andrew Morton <akpm@linux-foundation.org>
      cc: linux-afs@lists.infradead.org
      Link: https://lore.kernel.org/r/YLAXfvZ+rObEOdc%2F@localhost.localdomain/ [1]
      Link: https://lore.kernel.org/r/643721.1623754699@warthog.procyon.org.uk/
      Link: https://lore.kernel.org/r/162430903582.28961998.6098150063997983353.stgit@warthog.procyon.org.uk/ # v1
      Link: https://lore.kernel.org/r/162609463957.3133237.15916579353149746363.stgit@warthog.procyon.org.uk/ # v1 (repost)
      Link: https://lore.kernel.org/r/162610726860.3408253.445207609466288531.stgit@warthog.procyon.org.uk/ # v2
      6c881ca0
    • Jonathan Marek's avatar
      Revert "mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge" · d8a71905
      Jonathan Marek authored
      This reverts commit c742199a.
      
      c742199a ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge")
      breaks arm64 in at least two ways for configurations where PUD or PMD
      folding occur:
      
        1. We no longer install huge-vmap mappings and silently fall back to
           page-granular entries, despite being able to install block entries
           at what is effectively the PGD level.
      
        2. If the linear map is backed with block mappings, these will now
           silently fail to be created in alloc_init_pud(), causing a panic
           early during boot.
      
      The pgtable selftests caught this, although a fix has not been
      forthcoming and Christophe is AWOL at the moment, so just revert the
      change for now to get a working -rc3 on which we can queue patches for
      5.15.
      
      A simple revert breaks the build for 32-bit PowerPC 8xx machines, which
      rely on the default function definitions when the corresponding
      page-table levels are folded, since commit a6a8f7c4 ("powerpc/8xx:
      add support for huge pages on VMAP and VMALLOC"), eg:
      
        powerpc64-linux-ld: mm/vmalloc.o: in function `vunmap_pud_range':
        linux/mm/vmalloc.c:362: undefined reference to `pud_clear_huge'
      
      To avoid that, add stubs for pud_clear_huge() and pmd_clear_huge() in
      arch/powerpc/mm/nohash/8xx.c as suggested by Christophe.
      
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Fixes: c742199a
      
       ("mm/pgtable: add stubs for {pmd/pub}_{set/clear}_huge")
      Signed-off-by: default avatarJonathan Marek <jonathan@marek.ca>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      [mpe: Fold in 8xx.c changes from Christophe and mention in change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/linux-arm-kernel/CAMuHMdXShORDox-xxaeUfDW3wx2PeggFSqhVSHVZNKCGK-y_vQ@mail.gmail.com/
      Link: https://lore.kernel.org/r/20210717160118.9855-1-jonathan@marek.ca
      Link: https://lore.kernel.org/r/87r1fs1762.fsf@mpe.ellerman.id.au
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      d8a71905
    • Jean-Philippe Brucker's avatar
      arm64: smccc: Save lr before calling __arm_smccc_sve_check() · a7c3acca
      Jean-Philippe Brucker authored
      Commit cfa7ff95
      
       ("arm64: smccc: Support SMCCC v1.3 SVE register
      saving hint") added a call to __arm_smccc_sve_check() which clobbers the
      lr (register x30), causing __arm_smccc_hvc() to return to itself and
      crash. Save lr on the stack before calling __arm_smccc_sve_check(). Save
      the frame pointer (x29) to complete the frame record, and adjust the
      offsets used to access stack parameters.
      
      Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Fixes: cfa7ff95
      
       ("arm64: smccc: Support SMCCC v1.3 SVE register saving hint")
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
      Link: https://lore.kernel.org/r/20210721071834.69130-1-jean-philippe@linaro.org
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      a7c3acca
    • Markus Boehme's avatar
      ixgbe: Fix packet corruption due to missing DMA sync · 09cfae9f
      Markus Boehme authored
      When receiving a packet with multiple fragments, hardware may still
      touch the first fragment until the entire packet has been received. The
      driver therefore keeps the first fragment mapped for DMA until end of
      packet has been asserted, and delays its dma_sync call until then.
      
      The driver tries to fit multiple receive buffers on one page. When using
      3K receive buffers (e.g. using Jumbo frames and legacy-rx is turned
      off/build_skb is being used) on an architecture with 4K pages, the
      driver allocates an order 1 compound page and uses one page per receive
      buffer. To determine the correct offset for a delayed DMA sync of the
      first fragment of a multi-fragment packet, the driver then cannot just
      use PAGE_MASK on the DMA address but has to construct a mask based on
      the actual size of the backing page.
      
      Using PAGE_MASK in the 3K RX buffer/4K page architecture configuration
      will always sync the first page of a compound page. With the SWIOTLB
      enabled this can lead to corrupted packets (zeroed out first fragment,
      re-used garbage from another packet) and various consequences, such as
      slow/stalling data transfers and connection resets. For example, testing
      on a link with MTU exceeding 3058 bytes on a host with SWIOTLB enabled
      (e.g. "iommu=soft swiotlb=262144,force") TCP transfers quickly fizzle
      out without this patch.
      
      Cc: stable@vger.kernel.org
      Fixes: 0c5661ec
      
       ("ixgbe: fix crash in build_skb Rx code path")
      Signed-off-by: default avatarMarkus Boehme <markubo@amazon.com>
      Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09cfae9f
  4. Jul 20, 2021