1. 23 Jul, 2021 1 commit
    • Johan Almbladh's avatar
      mac80211: Do not strip skb headroom on monitor frames · ec61cd49
      Johan Almbladh authored
      When a monitor interface is present together with other interfaces, a
      received skb is copied and received on the monitor netdev. Before, the
      copied skb was allocated with exactly the amount of space needed for
      the radiotap header, resulting in an skb without any headroom at all
      being received on the monitor netdev. With the introduction of eBPF
      and XDP in the kernel, skbs may be processed by custom eBPF programs.
      However, since the skb cannot be reallocated in the eBPF program, no
      more data or headers can be pushed. The old code made sure the final
      headroom was zero regardless of the value of NET_SKB_PAD, so increasing
      that constant would have no effect.
      
      Now we allocate monitor skb copies with a headroom of NET_SKB_PAD bytes
      before the radiotap header. Monitor interfaces now behave in the same
      way as other netdev interfaces that honor the NET_SKB_PAD constant.
      Signed-off-by: default avatarJohan Almbladh <johan.almbladh@anyfinetworks.com>
      Link: https://lore.kernel.org/r/20210628123713.2070753-1-johan.almbladh@anyfinetworks.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      ec61cd49
  2. 22 Jul, 2021 14 commits
    • 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
    • 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
  3. 21 Jul, 2021 19 commits
  4. 20 Jul, 2021 6 commits
    • 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
    • Heiko Carstens's avatar
      s390: update defconfigs · 0cde560a
      Heiko Carstens authored
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      0cde560a
    • kernel test robot's avatar
      s390/cpumf: fix semicolon.cocci warnings · 7d244643
      kernel test robot authored
      arch/s390/kernel/perf_cpum_cf.c:748:2-3: Unneeded semicolon
      
       Remove unneeded semicolon.
      
      Generated by: scripts/coccinelle/misc/semicolon.cocci
      
      Fixes: a029a4ea ("s390/cpumf: Allow concurrent access for CPU Measurement Counter Facility")
      CC: Thomas Richter <tmricht@linux.ibm.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      7d244643
    • Alexander Egorenkov's avatar
      s390/boot: fix use of expolines in the DMA code · 463f36c7
      Alexander Egorenkov authored
      The DMA code section of the decompressor must be compiled with expolines
      if Spectre V2 mitigation has been enabled for the decompressed kernel.
      This is required because although the decompressor's image contains
      the DMA code section, it is handed over to the decompressed kernel for use.
      
      Because the DMA code is already slow w/o expolines, use expolines always
      regardless whether the decompressed kernel is using them or not. This
      simplifies the DMA code by dropping the conditional compilation of
      expolines.
      
      Fixes: bf726301 ("s390: use proper expoline sections for .dma code")
      Cc: <stable@vger.kernel.org> # 5.2
      Signed-off-by: default avatarAlexander Egorenkov <egorenar@linux.ibm.com>
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      463f36c7
    • Jia He's avatar
      Revert "qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()" · 91bed556
      Jia He authored
      This reverts commit 6206b798.
      
      That patch added additional spin_{un}lock_bh(), which was harmless
      but pointless. The orginal code path has guaranteed the pair of
      spin_{un}lock_bh().
      
      We'd better revert it before we find the exact root cause of the
      bug_on mentioned in that patch.
      
      Fixes: 6206b798 ("qed: fix possible unpaired spin_{un}lock_bh in _qed_mcp_cmd_and_union()")
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Prabhakar Kushwaha <pkushwaha@marvell.com>
      Signed-off-by: default avatarJia He <justin.he@arm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      91bed556
    • Paolo Abeni's avatar
      ipv6: fix another slab-out-of-bounds in fib6_nh_flush_exceptions · 8fb4792f
      Paolo Abeni authored
      While running the self-tests on a KASAN enabled kernel, I observed a
      slab-out-of-bounds splat very similar to the one reported in
      commit 821bbf79 ("ipv6: Fix KASAN: slab-out-of-bounds Read in
       fib6_nh_flush_exceptions").
      
      We additionally need to take care of fib6_metrics initialization
      failure when the caller provides an nh.
      
      The fix is similar, explicitly free the route instead of calling
      fib6_info_release on a half-initialized object.
      
      Fixes: f88d8ea6 ("ipv6: Plumb support for nexthop object in a fib6_info")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fb4792f