Skip to content
  1. Mar 29, 2024
    • Hariprasad Kelam's avatar
      octeontx2-af: Fix issue with loading coalesced KPU profiles · 0ba80d96
      Hariprasad Kelam authored
      The current implementation for loading coalesced KPU profiles has
      a limitation.  The "offset" field, which is used to locate profiles
      within the profile is restricted to a u16.
      
      This restricts the number of profiles that can be loaded. This patch
      addresses this limitation by increasing the size of the "offset" field.
      
      Fixes: 11c730bf
      
       ("octeontx2-af: support for coalescing KPU profiles")
      Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
      Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ba80d96
    • David S. Miller's avatar
      Merge branch 'gro-fixes' · ad69a730
      David S. Miller authored
      
      
      Antoine Tenart says:
      
      ====================
      gro: various fixes related to UDP tunnels
      
      We found issues when a UDP tunnel endpoint is in a different netns than
      where UDP GRO happens. This kind of setup is actually quite diverse,
      from having one leg of the tunnel on a remove host, to having a tunnel
      between netns (eg. being bridged in another one or on the host). In our
      case that UDP tunnel was geneve.
      
      UDP tunnel packets should not be GROed at the UDP level. The fundamental
      issue here is such packet can't be detected in a foolproof way: we can't
      know by looking at a packet alone and the current logic of looking up
      UDP sockets is fragile (socket could be in another netns, packet could
      be modified in between, etc). Because there is no way to make the GRO
      code to correctly handle those packets in all cases, this series aims at
      two things: making the net stack to correctly behave (as in, no crash
      and no invalid packet) when such thing happens, and in some cases to
      prevent this "early GRO" from happening.
      
      First three patches fix issues when an "UDP tunneled" packet is being
      GROed too early by rx-udp-gro-forwarding or rx-gro-list.
      
      Last patch is preventing locally generated UDP tunnel packets from being
      GROed. This turns out to be more complex than this patch alone as it
      relies on skb->encapsulation which is currently untrusty in some cases
      (see iptunnel_handle_offloads); but that should fix things in practice
      and is acceptable for a fix. Future work is required to improve things
      (prevent all locally generated UDP tunnel packets from being GROed),
      such as fixing the misuse of skb->encapsulation in drivers; but that
      would be net-next material.
      
      Thanks!
      Antoine
      
      Since v3:
        - Fixed the udpgro_fwd selftest in patch 5 (Jakub Kicinski feedback).
        - Improved commit message on patch 3 (Willem de Bruijn feeback).
      
      Since v2:
        - Fixed a build issue with IPv6=m in patch 1 (Jakub Kicinski
          feedback).
        - Fixed typo in patch 1 (Nikolay Aleksandrov feedback).
        - Added Reviewed-by tag on patch 2 (Willem de Bruijn feeback).
        - Added back conversion to CHECKSUM_UNNECESSARY but only from non
          CHECKSUM_PARTIAL in patch 3 (Paolo Abeni & Willem de Bruijn
          feeback).
        - Reworded patch 3 commit msg.
      
      Since v1:
        - Fixed a build issue with IPv6 disabled in patch 1.
        - Reworked commit log in patch 2 (Willem de Bruijn feedback).
        - Added Reviewed-by tags on patches 1 & 4 (Willem de Bruijn feeback).
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad69a730
    • Antoine Tenart's avatar
      selftests: net: gro fwd: update vxlan GRO test expectations · 0fb101be
      Antoine Tenart authored
      UDP tunnel packets can't be GRO in-between their endpoints as this
      causes different issues. The UDP GRO fwd vxlan tests were relying on
      this and their expectations have to be fixed.
      
      We keep both vxlan tests and expected no GRO from happening. The vxlan
      UDP GRO bench test was removed as it's not providing any valuable
      information now.
      
      Fixes: a062260a
      
       ("selftests: net: add UDP GRO forwarding self-tests")
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fb101be
    • Antoine Tenart's avatar
      udp: prevent local UDP tunnel packets from being GROed · 64235eab
      Antoine Tenart authored
      GRO has a fundamental issue with UDP tunnel packets as it can't detect
      those in a foolproof way and GRO could happen before they reach the
      tunnel endpoint. Previous commits have fixed issues when UDP tunnel
      packets come from a remote host, but if those packets are issued locally
      they could run into checksum issues.
      
      If the inner packet has a partial checksum the information will be lost
      in the GRO logic, either in udp4/6_gro_complete or in
      udp_gro_complete_segment and packets will have an invalid checksum when
      leaving the host.
      
      Prevent local UDP tunnel packets from ever being GROed at the outer UDP
      level.
      
      Due to skb->encapsulation being wrongly used in some drivers this is
      actually only preventing UDP tunnel packets with a partial checksum to
      be GROed (see iptunnel_handle_offloads) but those were also the packets
      triggering issues so in practice this should be sufficient.
      
      Fixes: 9fd1ff5d ("udp: Support UDP fraglist GRO/GSO.")
      Fixes: 36707061
      
       ("udp: allow forwarding of plain (non-fraglisted) UDP GRO packets")
      Suggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64235eab
    • Antoine Tenart's avatar
      udp: do not transition UDP GRO fraglist partial checksums to unnecessary · f0b8c303
      Antoine Tenart authored
      UDP GRO validates checksums and in udp4/6_gro_complete fraglist packets
      are converted to CHECKSUM_UNNECESSARY to avoid later checks. However
      this is an issue for CHECKSUM_PARTIAL packets as they can be looped in
      an egress path and then their partial checksums are not fixed.
      
      Different issues can be observed, from invalid checksum on packets to
      traces like:
      
        gen01: hw csum failure
        skb len=3008 headroom=160 headlen=1376 tailroom=0
        mac=(106,14) net=(120,40) trans=160
        shinfo(txflags=0 nr_frags=0 gso(size=0 type=0 segs=0))
        csum(0xffff232e ip_summed=2 complete_sw=0 valid=0 level=0)
        hash(0x77e3d716 sw=1 l4=1) proto=0x86dd pkttype=0 iif=12
        ...
      
      Fix this by only converting CHECKSUM_NONE packets to
      CHECKSUM_UNNECESSARY by reusing __skb_incr_checksum_unnecessary. All
      other checksum types are kept as-is, including CHECKSUM_COMPLETE as
      fraglist packets being segmented back would have their skb->csum valid.
      
      Fixes: 9fd1ff5d
      
       ("udp: Support UDP fraglist GRO/GSO.")
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f0b8c303
    • Antoine Tenart's avatar
      gro: fix ownership transfer · ed4cccef
      Antoine Tenart authored
      If packets are GROed with fraglist they might be segmented later on and
      continue their journey in the stack. In skb_segment_list those skbs can
      be reused as-is. This is an issue as their destructor was removed in
      skb_gro_receive_list but not the reference to their socket, and then
      they can't be orphaned. Fix this by also removing the reference to the
      socket.
      
      For example this could be observed,
      
        kernel BUG at include/linux/skbuff.h:3131!  (skb_orphan)
        RIP: 0010:ip6_rcv_core+0x11bc/0x19a0
        Call Trace:
         ipv6_list_rcv+0x250/0x3f0
         __netif_receive_skb_list_core+0x49d/0x8f0
         netif_receive_skb_list_internal+0x634/0xd40
         napi_complete_done+0x1d2/0x7d0
         gro_cell_poll+0x118/0x1f0
      
      A similar construction is found in skb_gro_receive, apply the same
      change there.
      
      Fixes: 5e10da53
      
       ("skbuff: allow 'slow_gro' for skb carring sock reference")
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ed4cccef
    • Antoine Tenart's avatar
      udp: do not accept non-tunnel GSO skbs landing in a tunnel · 3d010c80
      Antoine Tenart authored
      When rx-udp-gro-forwarding is enabled UDP packets might be GROed when
      being forwarded. If such packets might land in a tunnel this can cause
      various issues and udp_gro_receive makes sure this isn't the case by
      looking for a matching socket. This is performed in
      udp4/6_gro_lookup_skb but only in the current netns. This is an issue
      with tunneled packets when the endpoint is in another netns. In such
      cases the packets will be GROed at the UDP level, which leads to various
      issues later on. The same thing can happen with rx-gro-list.
      
      We saw this with geneve packets being GROed at the UDP level. In such
      case gso_size is set; later the packet goes through the geneve rx path,
      the geneve header is pulled, the offset are adjusted and frag_list skbs
      are not adjusted with regard to geneve. When those skbs hit
      skb_fragment, it will misbehave. Different outcomes are possible
      depending on what the GROed skbs look like; from corrupted packets to
      kernel crashes.
      
      One example is a BUG_ON[1] triggered in skb_segment while processing the
      frag_list. Because gso_size is wrong (geneve header was pulled)
      skb_segment thinks there is "geneve header size" of data in frag_list,
      although it's in fact the next packet. The BUG_ON itself has nothing to
      do with the issue. This is only one of the potential issues.
      
      Looking up for a matching socket in udp_gro_receive is fragile: the
      lookup could be extended to all netns (not speaking about performances)
      but nothing prevents those packets from being modified in between and we
      could still not find a matching socket. It's OK to keep the current
      logic there as it should cover most cases but we also need to make sure
      we handle tunnel packets being GROed too early.
      
      This is done by extending the checks in udp_unexpected_gso: GSO packets
      lacking the SKB_GSO_UDP_TUNNEL/_CSUM bits and landing in a tunnel must
      be segmented.
      
      [1] kernel BUG at net/core/skbuff.c:4408!
          RIP: 0010:skb_segment+0xd2a/0xf70
          __udp_gso_segment+0xaa/0x560
      
      Fixes: 9fd1ff5d ("udp: Support UDP fraglist GRO/GSO.")
      Fixes: 36707061
      
       ("udp: allow forwarding of plain (non-fraglisted) UDP GRO packets")
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d010c80
    • Lukasz Majewski's avatar
      net: hsr: Use full string description when opening HSR network device · 10e52ad5
      Lukasz Majewski authored
      
      
      Up till now only single character ('A' or 'B') was used to provide
      information of HSR slave network device status.
      
      As it is also possible and valid, that Interlink network device may
      be supported as well, the description must be more verbose. As a result
      the full string description is now used.
      
      Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      10e52ad5
    • Jakub Kicinski's avatar
      Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 1ae289b0
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2024-03-27 (e1000e)
      
      This series contains updates to e1000e driver only.
      
      Vitaly adds retry mechanism for some PHY operations to workaround MDI
      error and moves SMBus configuration to avoid possible PHY loss.
      
      * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
        e1000e: move force SMBUS from enable ulp function to avoid PHY loss issue
        e1000e: Workaround for sporadic MDI error on Meteor Lake systems
      ====================
      
      Link: https://lore.kernel.org/r/20240327185517.2587564-1-anthony.l.nguyen@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1ae289b0
    • Jesper Dangaard Brouer's avatar
      xen-netfront: Add missing skb_mark_for_recycle · 03796540
      Jesper Dangaard Brouer authored
      Notice that skb_mark_for_recycle() is introduced later than fixes tag in
      commit 6a5bcd84 ("page_pool: Allow drivers to hint on SKB recycling").
      
      It is believed that fixes tag were missing a call to page_pool_release_page()
      between v5.9 to v5.14, after which is should have used skb_mark_for_recycle().
      Since v6.6 the call page_pool_release_page() were removed (in
      commit 535b9c61 ("net: page_pool: hide page_pool_release_page()")
      and remaining callers converted (in commit 6bfef2ec ("Merge branch
      'net-page_pool-remove-page_pool_release_page'")).
      
      This leak became visible in v6.8 via commit dba1b8a7 ("mm/page_pool: catch
      page_pool memory leaks").
      
      Cc: stable@vger.kernel.org
      Fixes: 6c5aa6fc
      
       ("xen networking: add basic XDP support for xen-netfront")
      Reported-by: default avatarLeonidas Spyropoulos <artafinde@archlinux.com>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=218654
      
      
      Reported-by: default avatarArthur Borsboom <arthurborsboom@gmail.com>
      Signed-off-by: default avatarJesper Dangaard Brouer <hawk@kernel.org>
      Link: https://lore.kernel.org/r/171154167446.2671062.9127105384591237363.stgit@firesoul
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      03796540
    • Krzysztof Kozlowski's avatar
      ptp: MAINTAINERS: drop Jeff Sipek · fa845139
      Krzysztof Kozlowski authored
      
      
      Emails to Jeff Sipek bounce:
      
        Your message to jsipek@vmware.com couldn't be delivered.
        Recipient is not authorized to accept external mail
        Status code: 550 5.7.1_ETR
      
      Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Link: https://lore.kernel.org/r/20240327081413.306054-1-krzysztof.kozlowski@linaro.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      fa845139
    • William Tu's avatar
      Documentation: Add documentation for eswitch attribute · 931ec1e4
      William Tu authored
      
      
      Provide devlink documentation for three eswitch attributes:
      mode, inline-mode, and encap-mode.
      
      Signed-off-by: default avatarWilliam Tu <witu@nvidia.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/r/20240325181228.6244-1-witu@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      931ec1e4
    • Linus Torvalds's avatar
      Merge tag 'net-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 50108c35
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from bpf, WiFi and netfilter.
      
        Current release - regressions:
      
         - ipv6: fix address dump when IPv6 is disabled on an interface
      
        Current release - new code bugs:
      
         - bpf: temporarily disable atomic operations in BPF arena
      
         - nexthop: fix uninitialized variable in nla_put_nh_group_stats()
      
        Previous releases - regressions:
      
         - bpf: protect against int overflow for stack access size
      
         - hsr: fix the promiscuous mode in offload mode
      
         - wifi: don't always use FW dump trig
      
         - tls: adjust recv return with async crypto and failed copy to
           userspace
      
         - tcp: properly terminate timers for kernel sockets
      
         - ice: fix memory corruption bug with suspend and rebuild
      
         - at803x: fix kernel panic with at8031_probe
      
         - qeth: handle deferred cc1
      
        Previous releases - always broken:
      
         - bpf: fix bug in BPF_LDX_MEMSX
      
         - netfilter: reject table flag and netdev basechain updates
      
         - inet_defrag: prevent sk release while still in use
      
         - wifi: pick the version of SESSION_PROTECTION_NOTIF
      
         - wwan: t7xx: split 64bit accesses to fix alignment issues
      
         - mlxbf_gige: call request_irq() after NAPI initialized
      
         - hns3: fix kernel crash when devlink reload during pf
           initialization"
      
      * tag 'net-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (81 commits)
        inet: inet_defrag: prevent sk release while still in use
        Octeontx2-af: fix pause frame configuration in GMP mode
        net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips
        net: bcmasp: Remove phy_{suspend/resume}
        net: bcmasp: Bring up unimac after PHY link up
        net: phy: qcom: at803x: fix kernel panic with at8031_probe
        netfilter: arptables: Select NETFILTER_FAMILY_ARP when building arp_tables.c
        netfilter: nf_tables: skip netdev hook unregistration if table is dormant
        netfilter: nf_tables: reject table flag and netdev basechain updates
        netfilter: nf_tables: reject destroy command to remove basechain hooks
        bpf: update BPF LSM designated reviewer list
        bpf: Protect against int overflow for stack access size
        bpf: Check bloom filter map value size
        bpf: fix warning for crash_kexec
        selftests: netdevsim: set test timeout to 10 minutes
        net: wan: framer: Add missing static inline qualifiers
        mlxbf_gige: call request_irq() after NAPI initialized
        tls: get psock ref after taking rxlock to avoid leak
        selftests: tls: add test with a partially invalid iov
        tls: adjust recv return with async crypto and failed copy to userspace
        ...
      50108c35
  2. Mar 28, 2024