1. 17 Nov, 2023 31 commits
  2. 16 Nov, 2023 9 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 7475e51b
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from BPF and netfilter.
      
        Current release - regressions:
      
         - core: fix undefined behavior in netdev name allocation
      
         - bpf: do not allocate percpu memory at init stage
      
         - netfilter: nf_tables: split async and sync catchall in two
           functions
      
         - mptcp: fix possible NULL pointer dereference on close
      
        Current release - new code bugs:
      
         - eth: ice: dpll: fix initial lock status of dpll
      
        Previous releases - regressions:
      
         - bpf: fix precision backtracking instruction iteration
      
         - af_unix: fix use-after-free in unix_stream_read_actor()
      
         - tipc: fix kernel-infoleak due to uninitialized TLV value
      
         - eth: bonding: stop the device in bond_setup_by_slave()
      
         - eth: mlx5:
            - fix double free of encap_header
            - avoid referencing skb after free-ing in drop path
      
         - eth: hns3: fix VF reset
      
         - eth: mvneta: fix calls to page_pool_get_stats
      
        Previous releases - always broken:
      
         - core: set SOCK_RCU_FREE before inserting socket into hashtable
      
         - bpf: fix control-flow graph checking in privileged mode
      
         - eth: ppp: limit MRU to 64K
      
         - eth: stmmac: avoid rx queue overrun
      
         - eth: icssg-prueth: fix error cleanup on failing initialization
      
         - eth: hns3: fix out-of-bounds access may occur when coalesce info is
           read via debugfs
      
         - eth: cortina: handle large frames
      
        Misc:
      
         - selftests: gso: support CONFIG_MAX_SKB_FRAGS up to 45"
      
      * tag 'net-6.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (78 commits)
        macvlan: Don't propagate promisc change to lower dev in passthru
        net: sched: do not offload flows with a helper in act_ct
        net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors
        net/mlx5e: Check return value of snprintf writing to fw_version buffer
        net/mlx5e: Reduce the size of icosq_str
        net/mlx5: Increase size of irq name buffer
        net/mlx5e: Update doorbell for port timestamping CQ before the software counter
        net/mlx5e: Track xmit submission to PTP WQ after populating metadata map
        net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe
        net/mlx5e: Don't modify the peer sent-to-vport rules for IPSec offload
        net/mlx5e: Fix pedit endianness
        net/mlx5e: fix double free of encap_header in update funcs
        net/mlx5e: fix double free of encap_header
        net/mlx5: Decouple PHC .adjtime and .adjphase implementations
        net/mlx5: DR, Allow old devices to use multi destination FTE
        net/mlx5: Free used cpus mask when an IRQ is released
        Revert "net/mlx5: DR, Supporting inline WQE when possible"
        bpf: Do not allocate percpu memory at init stage
        net: Fix undefined behavior in netdev name allocation
        dt-bindings: net: ethernet-controller: Fix formatting error
        ...
      7475e51b
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.7a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 6eb1acd9
      Linus Torvalds authored
      Pull xen updates from Juergen Gross:
      
       - A fix in the Xen events driver avoiding the use of RCU after
         the call to rcu_report_dead() when taking a cpu down
      
       - A fix for running as Xen dom0 to line up ACPI's idea of power
         management capabilities with the one of Xen
      
       - A cleanup eliminating several kernel-doc warnings in Xen related
         code
      
       - A cleanup series of the Xen events driver
      
      * tag 'for-linus-6.7a-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/events: remove some info_for_irq() calls in pirq handling
        xen/events: modify internal [un]bind interfaces
        xen/events: drop xen_allocate_irqs_dynamic()
        xen/events: remove some simple helpers from events_base.c
        xen/events: reduce externally visible helper functions
        xen/events: remove unused functions
        xen/events: fix delayed eoi list handling
        xen/shbuf: eliminate 17 kernel-doc warnings
        acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0
        xen/events: avoid using info_for_irq() in xen_send_IPI_one()
      6eb1acd9
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · 372bed5f
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "Bugfixes all over the place"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vhost-vdpa: fix use after free in vhost_vdpa_probe()
        virtio_pci: Switch away from deprecated irq_set_affinity_hint
        riscv, qemu_fw_cfg: Add support for RISC-V architecture
        vdpa_sim_blk: allocate the buffer zeroed
        virtio_pci: move structure to a header
      372bed5f
    • Paolo Abeni's avatar
      Merge tag 'nf-23-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · cff088d9
      Paolo Abeni authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Remove unused variable causing compilation warning in nft_set_rbtree,
         from Yang Li. This unused variable is a left over from previous
         merge window.
      
      2) Possible return of uninitialized in nf_conntrack_bridge, from
         Linkui Xiao. This is there since nf_conntrack_bridge is available.
      
      3) Fix incorrect pointer math in nft_byteorder, from Dan Carpenter.
         Problem has been there since 2016.
      
      4) Fix bogus error in destroy set element command. Problem is there
         since this new destroy command was added.
      
      5) Fix race condition in ipset between swap and destroy commands and
         add/del/test control plane. This problem is there since ipset was
         merged.
      
      6) Split async and sync catchall GC in two function to fix unsafe
         iteration over RCU. This is a fix-for-fix that was included in
         the previous pull request.
      
      * tag 'nf-23-11-15' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
        netfilter: nf_tables: split async and sync catchall in two functions
        netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test
        netfilter: nf_tables: bogus ENOENT when destroying element which does not exist
        netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()
        netfilter: nf_conntrack_bridge: initialize err to 0
        netfilter: nft_set_rbtree: Remove unused variable nft_net
      ====================
      
      Link: https://lore.kernel.org/r/20231115184514.8965-1-pablo@netfilter.orgSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      cff088d9
    • Vlad Buslov's avatar
      macvlan: Don't propagate promisc change to lower dev in passthru · 7e1caeac
      Vlad Buslov authored
      Macvlan device in passthru mode sets its lower device promiscuous mode
      according to its MACVLAN_FLAG_NOPROMISC flag instead of synchronizing it to
      its own promiscuity setting. However, macvlan_change_rx_flags() function
      doesn't check the mode before propagating such changes to the lower device
      which can cause net_device->promiscuity counter overflow as illustrated by
      reproduction example [0] and resulting dmesg log [1]. Fix the issue by
      first verifying the mode in macvlan_change_rx_flags() function before
      propagating promiscuous mode change to the lower device.
      
      [0]:
      ip link add macvlan1 link enp8s0f0 type macvlan mode passthru
      ip link set macvlan1 promisc on
      ip l set dev macvlan1 up
      ip link set macvlan1 promisc off
      ip l set dev macvlan1 down
      ip l set dev macvlan1 up
      
      [1]:
      [ 5156.281724] macvlan1: entered promiscuous mode
      [ 5156.285467] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode
      [ 5156.287639] macvlan1: left promiscuous mode
      [ 5156.288339] mlx5_core 0000:08:00.0 enp8s0f0: left promiscuous mode
      [ 5156.290907] mlx5_core 0000:08:00.0 enp8s0f0: entered promiscuous mode
      [ 5156.317197] mlx5_core 0000:08:00.0 enp8s0f0: promiscuity touches roof, set promiscuity failed. promiscuity feature of device might be broken.
      
      Fixes: efdbd2b3 ("macvlan: Propagate promiscuity setting to lower devices.")
      Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
      Signed-off-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20231114175915.1649154-1-vladbu@nvidia.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7e1caeac
    • Xin Long's avatar
      net: sched: do not offload flows with a helper in act_ct · 7cd5af0e
      Xin Long authored
      There is no hardware supporting ct helper offload. However, prior to this
      patch, a flower filter with a helper in the ct action can be successfully
      set into the HW, for example (eth1 is a bnxt NIC):
      
        # tc qdisc add dev eth1 ingress_block 22 ingress
        # tc filter add block 22 proto ip flower skip_sw ip_proto tcp \
          dst_port 21 ct_state -trk action ct helper ipv4-tcp-ftp
        # tc filter show dev eth1 ingress
      
          filter block 22 protocol ip pref 49152 flower chain 0 handle 0x1
            eth_type ipv4
            ip_proto tcp
            dst_port 21
            ct_state -trk
            skip_sw
            in_hw in_hw_count 1   <----
              action order 1: ct zone 0 helper ipv4-tcp-ftp pipe
               index 2 ref 1 bind 1
              used_hw_stats delayed
      
      This might cause the flower filter not to work as expected in the HW.
      
      This patch avoids this problem by simply returning -EOPNOTSUPP in
      tcf_ct_offload_act_setup() to not allow to offload flows with a helper
      in act_ct.
      
      Fixes: a21b06e7 ("net: sched: add helper support in act_ct")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
      Link: https://lore.kernel.org/r/f8685ec7702c4a448a1371a8b34b43217b583b9d.1699898008.git.lucien.xin@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7cd5af0e
    • Jakub Kicinski's avatar
      Merge branch 'mlx5-fixes-2023-11-13-manual' · bdc454fc
      Jakub Kicinski authored
      Saeed Mahameed says:
      
      ====================
      This series provides bug fixes to mlx5 driver.
      ====================
      
      Link: https://lore.kernel.org/r/20231114215846.5902-1-saeed@kernel.org/Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bdc454fc
    • Rahul Rameshbabu's avatar
      net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors · 1b2bd0c0
      Rahul Rameshbabu authored
      Treat the operation as an error case when the return value is equivalent to
      the size of the name buffer. Failed to write null terminator to the name
      buffer, making the string malformed and should not be used. Provide a
      string with only the firmware version when forming the string with the
      board id fails. This logic for representors is identical to normal flow
      with ethtool.
      
      Without check, will trigger -Wformat-truncation with W=1.
      
          drivers/net/ethernet/mellanox/mlx5/core/en_rep.c: In function 'mlx5e_rep_get_drvinfo':
          drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:78:31: warning: '%.16s' directive output may be truncated writing up to 16 bytes into a region of size between 13 and 22 [-Wformat-truncation=]
            78 |                  "%d.%d.%04d (%.16s)",
               |                               ^~~~~
          drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:77:9: note: 'snprintf' output between 12 and 37 bytes into a destination of size 32
            77 |         snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
               |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            78 |                  "%d.%d.%04d (%.16s)",
               |                  ~~~~~~~~~~~~~~~~~~~~~
            79 |                  fw_rev_maj(mdev), fw_rev_min(mdev),
               |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            80 |                  fw_rev_sub(mdev), mdev->board_id);
               |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Fixes: cf83c8fd ("net/mlx5e: Add missing ethtool driver info for representors")
      Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732cSigned-off-by: default avatarRahul Rameshbabu <rrameshbabu@nvidia.com>
      Reviewed-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Link: https://lore.kernel.org/r/20231114215846.5902-16-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1b2bd0c0
    • Rahul Rameshbabu's avatar
      net/mlx5e: Check return value of snprintf writing to fw_version buffer · 41e63c2b
      Rahul Rameshbabu authored
      Treat the operation as an error case when the return value is equivalent to
      the size of the name buffer. Failed to write null terminator to the name
      buffer, making the string malformed and should not be used. Provide a
      string with only the firmware version when forming the string with the
      board id fails.
      
      Without check, will trigger -Wformat-truncation with W=1.
      
          drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c: In function 'mlx5e_ethtool_get_drvinfo':
          drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:49:31: warning: '%.16s' directive output may be truncated writing up to 16 bytes into a region of size between 13 and 22 [-Wformat-truncation=]
            49 |                  "%d.%d.%04d (%.16s)",
               |                               ^~~~~
          drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:48:9: note: 'snprintf' output between 12 and 37 bytes into a destination of size 32
            48 |         snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
               |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            49 |                  "%d.%d.%04d (%.16s)",
               |                  ~~~~~~~~~~~~~~~~~~~~~
            50 |                  fw_rev_maj(mdev), fw_rev_min(mdev), fw_rev_sub(mdev),
               |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            51 |                  mdev->board_id);
               |                  ~~~~~~~~~~~~~~~
      
      Fixes: 84e11edb ("net/mlx5e: Show board id in ethtool driver information")
      Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6d4ab2e97dcfbcd748ae71761a9d8e5e41cc732cSigned-off-by: default avatarRahul Rameshbabu <rrameshbabu@nvidia.com>
      Reviewed-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      41e63c2b