1. 08 Feb, 2023 8 commits
    • Shay Drory's avatar
      net/mlx5: fw_tracer, Clear load bit when freeing string DBs buffers · db561fed
      Shay Drory authored
      Whenever the driver is reading the string DBs into buffers, the driver
      is setting the load bit, but the driver never clears this bit.
      As a result, in case load bit is on and the driver query the device for
      new string DBs, the driver won't read again the string DBs.
      Fix it by clearing the load bit when query the device for new string
      DBs.
      
      Fixes: 2d693567 ("net/mlx5: Add support for fw live patch event")
      Signed-off-by: default avatarShay Drory <shayd@nvidia.com>
      Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      db561fed
    • Maher Sanalla's avatar
      net/mlx5: Expose SF firmware pages counter · 9965bbeb
      Maher Sanalla authored
      Currently, each core device has VF pages counter which stores number of
      fw pages used by its VFs and SFs.
      
      The current design led to a hang when performing firmware reset on DPU,
      where the DPU PFs stalled in sriov unload flow due to waiting on release
      of SFs pages instead of waiting on only VFs pages.
      
      Thus, Add a separate counter for SF firmware pages, which will prevent
      the stall scenario described above.
      
      Fixes: 1958fc2f ("net/mlx5: SF, Add auxiliary device driver")
      Signed-off-by: default avatarMaher Sanalla <msanalla@nvidia.com>
      Reviewed-by: default avatarShay Drory <shayd@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      9965bbeb
    • Maher Sanalla's avatar
      net/mlx5: Store page counters in a single array · c3bdbaea
      Maher Sanalla authored
      Currently, an independent page counter is used for tracking memory usage
      for each function type such as VF, PF and host PF (DPU).
      
      For better code-readibilty, use a single array that stores
      the number of allocated memory pages for each function type.
      Signed-off-by: default avatarMaher Sanalla <msanalla@nvidia.com>
      Reviewed-by: default avatarShay Drory <shayd@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      c3bdbaea
    • Dragos Tatulea's avatar
      net/mlx5e: IPoIB, Show unknown speed instead of error · 8aa5f171
      Dragos Tatulea authored
      ethtool is returning an error for unknown speeds for the IPoIB interface:
      
      $ ethtool ib0
      netlink error: failed to retrieve link settings
      netlink error: Invalid argument
      netlink error: failed to retrieve link settings
      netlink error: Invalid argument
      Settings for ib0:
      Link detected: no
      
      After this change, ethtool will return success and show "unknown speed":
      
      $ ethtool ib0
      Settings for ib0:
      Supported ports: [  ]
      Supported link modes:   Not reported
      Supported pause frame use: No
      Supports auto-negotiation: No
      Supported FEC modes: Not reported
      Advertised link modes:  Not reported
      Advertised pause frame use: No
      Advertised auto-negotiation: No
      Advertised FEC modes: Not reported
      Speed: Unknown!
      Duplex: Full
      Auto-negotiation: off
      Port: Other
      PHYAD: 0
      Transceiver: internal
      Link detected: no
      
      Fixes: eb234ee9 ("net/mlx5e: IPoIB, Add support for get_link_ksettings in ethtool")
      Signed-off-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
      Reviewed-by: default avatarGal Pressman <gal@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      8aa5f171
    • Amir Tzin's avatar
      net/mlx5e: Fix crash unsetting rx-vlan-filter in switchdev mode · 8974aa96
      Amir Tzin authored
      Moving to switchdev mode with rx-vlan-filter on and then setting it off
      causes the kernel to crash since fs->vlan is freed during nic profile
      cleanup flow.
      
      RX VLAN filtering is not supported in switchdev mode so unset it when
      changing to switchdev and restore its value when switching back to
      legacy.
      
      trace:
      [] RIP: 0010:mlx5e_disable_cvlan_filter+0x43/0x70
      [] set_feature_cvlan_filter+0x37/0x40 [mlx5_core]
      [] mlx5e_handle_feature+0x3a/0x60 [mlx5_core]
      [] mlx5e_set_features+0x6d/0x160 [mlx5_core]
      [] __netdev_update_features+0x288/0xa70
      [] ethnl_set_features+0x309/0x380
      [] ? __nla_parse+0x21/0x30
      [] genl_family_rcv_msg_doit.isra.17+0x110/0x150
      [] genl_rcv_msg+0x112/0x260
      [] ? features_reply_size+0xe0/0xe0
      [] ? genl_family_rcv_msg_doit.isra.17+0x150/0x150
      [] netlink_rcv_skb+0x4e/0x100
      [] genl_rcv+0x24/0x40
      [] netlink_unicast+0x1ab/0x290
      [] netlink_sendmsg+0x257/0x4f0
      [] sock_sendmsg+0x5c/0x70
      
      Fixes: cb67b832 ("net/mlx5e: Introduce SRIOV VF representors")
      Signed-off-by: default avatarAmir Tzin <amirtz@nvidia.com>
      Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      8974aa96
    • Vlad Buslov's avatar
      net/mlx5: Bridge, fix ageing of peer FDB entries · da0c5242
      Vlad Buslov authored
      SWITCHDEV_FDB_ADD_TO_BRIDGE event handler that updates FDB entry 'lastuse'
      field is only executed for eswitch that owns the entry. However, if peer
      entry processed packets at least once it will have hardware counter 'used'
      value greater than entry 'lastuse' from that point on, which will cause FDB
      entry not being aged out.
      
      Process the event on all eswitch instances.
      
      Fixes: ff9b7521 ("net/mlx5: Bridge, support LAG")
      Signed-off-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      da0c5242
    • Yevgeny Kliteynik's avatar
      net/mlx5: DR, Fix potential race in dr_rule_create_rule_nic · 288d85e0
      Yevgeny Kliteynik authored
      Selecting builder should be protected by the lock to prevent the case
      where a new rule sets a builder in the nic_matcher while the previous
      rule is still using the nic_matcher.
      
      Fixing this issue and cleaning the error flow.
      
      Fixes: b9b81e1e ("net/mlx5: DR, For short chains of STEs, avoid allocating ste_arr dynamically")
      Signed-off-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
      Reviewed-by: default avatarAlex Vesker <valex@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      288d85e0
    • Adham Faris's avatar
      net/mlx5e: Update rx ring hw mtu upon each rx-fcs flag change · 1e662209
      Adham Faris authored
      rq->hw_mtu is used in function en_rx.c/mlx5e_skb_from_cqe_mpwrq_linear()
      to catch oversized packets. If FCS is concatenated to the end of the
      packet then the check should be updated accordingly.
      
      Rx rings initialization (mlx5e_init_rxq_rq()) invoked for every new set
      of channels, as part of mlx5e_safe_switch_params(), unknowingly if it
      runs with default configuration or not. Current rq->hw_mtu
      initialization assumes default configuration and ignores
      params->scatter_fcs_en flag state.
      Fix this, by accounting for params->scatter_fcs_en flag state during
      rq->hw_mtu initialization.
      
      In addition, updating rq->hw_mtu value during ingress traffic might
      lead to packets drop and oversize_pkts_sw_drop counter increase with no
      good reason. Hence we remove this optimization and switch the set of
      channels with a new one, to make sure we don't get false positives on
      the oversize_pkts_sw_drop counter.
      
      Fixes: 102722fc ("net/mlx5e: Add support for RXFCS feature flag")
      Signed-off-by: default avatarAdham Faris <afaris@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      1e662209
  2. 07 Feb, 2023 4 commits
    • Jiri Pirko's avatar
      devlink: change port event netdev notifier from per-net to global · 565b4824
      Jiri Pirko authored
      Currently only the network namespace of devlink instance is monitored
      for port events. If netdev is moved to a different namespace and then
      unregistered, NETDEV_PRE_UNINIT is missed which leads to trigger
      following WARN_ON in devl_port_unregister().
      WARN_ON(devlink_port->type != DEVLINK_PORT_TYPE_NOTSET);
      
      Fix this by changing the netdev notifier from per-net to global so no
      event is missed.
      
      Fixes: 02a68a47 ("net: devlink: track netdev with devlink_port assigned")
      Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Link: https://lore.kernel.org/r/20230206094151.2557264-1-jiri@resnulli.usSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      565b4824
    • Vladimir Oltean's avatar
      selftests: ocelot: tc_flower_chains: make test_vlan_ingress_modify() more comprehensive · bbb253b2
      Vladimir Oltean authored
      We have two IS1 filters of the OCELOT_VCAP_KEY_ANY key type (the one with
      "action vlan pop" and the one with "action vlan modify") and one of the
      OCELOT_VCAP_KEY_IPV4 key type (the one with "action skbedit priority").
      But we have no IS1 filter with the OCELOT_VCAP_KEY_ETYPE key type, and
      there was an uncaught breakage there.
      
      To increase test coverage, convert one of the OCELOT_VCAP_KEY_ANY
      filters to OCELOT_VCAP_KEY_ETYPE, by making the filter also match on the
      MAC SA of the traffic sent by mausezahn, $h1_mac.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20230205192409.1796428-2-vladimir.oltean@nxp.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      bbb253b2
    • Vladimir Oltean's avatar
      net: mscc: ocelot: fix VCAP filters not matching on MAC with "protocol 802.1Q" · f964f839
      Vladimir Oltean authored
      Alternative short title: don't instruct the hardware to match on
      EtherType with "protocol 802.1Q" flower filters. It doesn't work for the
      reasons detailed below.
      
      With a command such as the following:
      
      tc filter add dev $swp1 ingress chain $(IS1 2) pref 3 \
      	protocol 802.1Q flower skip_sw vlan_id 200 src_mac $h1_mac \
      	action vlan modify id 300 \
      	action goto chain $(IS2 0 0)
      
      the created filter is set by ocelot_flower_parse_key() to be of type
      OCELOT_VCAP_KEY_ETYPE, and etype is set to {value=0x8100, mask=0xffff}.
      This gets propagated all the way to is1_entry_set() which commits it to
      hardware (the VCAP_IS1_HK_ETYPE field of the key). Compare this to the
      case where src_mac isn't specified - the key type is OCELOT_VCAP_KEY_ANY,
      and is1_entry_set() doesn't populate VCAP_IS1_HK_ETYPE.
      
      The problem is that for VLAN-tagged frames, the hardware interprets the
      ETYPE field as holding the encapsulated VLAN protocol. So the above
      filter will only match those packets which have an encapsulated protocol
      of 0x8100, rather than all packets with VLAN ID 200 and the given src_mac.
      
      The reason why this is allowed to occur is because, although we have a
      block of code in ocelot_flower_parse_key() which sets "match_protocol"
      to false when VLAN keys are present, that code executes too late.
      There is another block of code, which executes for Ethernet addresses,
      and has a "goto finished_key_parsing" and skips the VLAN header parsing.
      By skipping it, "match_protocol" remains with the value it was
      initialized with, i.e. "true", and "proto" is set to f->common.protocol,
      or 0x8100.
      
      The concept of ignoring some keys rather than erroring out when they are
      present but can't be offloaded is dubious in itself, but is present
      since the initial commit fe3490e6 ("net: mscc: ocelot: Hardware
      ofload for tc flower filter"), and it's outside of the scope of this
      patch to change that.
      
      The problem was introduced when the driver started to interpret the
      flower filter's protocol, and populate the VCAP filter's ETYPE field
      based on it.
      
      To fix this, it is sufficient to move the code that parses the VLAN keys
      earlier than the "goto finished_key_parsing" instruction. This will
      ensure that if we have a flower filter with both VLAN and Ethernet
      address keys, it won't match on ETYPE 0x8100, because the VLAN key
      parsing sets "match_protocol = false".
      
      Fixes: 86b956de ("net: mscc: ocelot: support matching on EtherType")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20230205192409.1796428-1-vladimir.oltean@nxp.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f964f839
    • Vladimir Oltean's avatar
      net: dsa: mt7530: don't change PVC_EG_TAG when CPU port becomes VLAN-aware · 0b6d6425
      Vladimir Oltean authored
      Frank reports that in a mt7530 setup where some ports are standalone and
      some are in a VLAN-aware bridge, 8021q uppers of the standalone ports
      lose their VLAN tag on xmit, as seen by the link partner.
      
      This seems to occur because once the other ports join the VLAN-aware
      bridge, mt7530_port_vlan_filtering() also calls
      mt7530_port_set_vlan_aware(ds, cpu_dp->index), and this affects the way
      that the switch processes the traffic of the standalone port.
      
      Relevant is the PVC_EG_TAG bit. The MT7530 documentation says about it:
      
      EG_TAG: Incoming Port Egress Tag VLAN Attribution
      0: disabled (system default)
      1: consistent (keep the original ingress tag attribute)
      
      My interpretation is that this setting applies on the ingress port, and
      "disabled" is basically the normal behavior, where the egress tag format
      of the packet (tagged or untagged) is decided by the VLAN table
      (MT7530_VLAN_EGRESS_UNTAG or MT7530_VLAN_EGRESS_TAG).
      
      But there is also an option of overriding the system default behavior,
      and for the egress tagging format of packets to be decided not by the
      VLAN table, but simply by copying the ingress tag format (if ingress was
      tagged, egress is tagged; if ingress was untagged, egress is untagged;
      aka "consistent). This is useful in 2 scenarios:
      
      - VLAN-unaware bridge ports will always encounter a miss in the VLAN
        table. They should forward a packet as-is, though. So we use
        "consistent" there. See commit e045124e ("net: dsa: mt7530: fix
        tagged frames pass-through in VLAN-unaware mode").
      
      - Traffic injected from the CPU port. The operating system is in god
        mode; if it wants a packet to exit as VLAN-tagged, it sends it as
        VLAN-tagged. Otherwise it sends it as VLAN-untagged*.
      
      *This is true only if we don't consider the bridge TX forwarding offload
      feature, which mt7530 doesn't support.
      
      So for now, make the CPU port always stay in "consistent" mode to allow
      software VLANs to be forwarded to their egress ports with the VLAN tag
      intact, and not stripped.
      
      Link: https://lore.kernel.org/netdev/trinity-e6294d28-636c-4c40-bb8b-b523521b00be-1674233135062@3c-app-gmx-bs36/
      Fixes: e045124e ("net: dsa: mt7530: fix tagged frames pass-through in VLAN-unaware mode")
      Reported-by: default avatarFrank Wunderlich <frank-w@public-files.de>
      Tested-by: default avatarFrank Wunderlich <frank-w@public-files.de>
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Tested-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20230205140713.1609281-1-vladimir.oltean@nxp.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      0b6d6425
  3. 06 Feb, 2023 4 commits
    • Alan Stern's avatar
      net: USB: Fix wrong-direction WARNING in plusb.c · 811d5811
      Alan Stern authored
      The syzbot fuzzer detected a bug in the plusb network driver: A
      zero-length control-OUT transfer was treated as a read instead of a
      write.  In modern kernels this error provokes a WARNING:
      
      usb 1-1: BOGUS control dir, pipe 80000280 doesn't match bRequestType c0
      WARNING: CPU: 0 PID: 4645 at drivers/usb/core/urb.c:411
      usb_submit_urb+0x14a7/0x1880 drivers/usb/core/urb.c:411
      Modules linked in:
      CPU: 1 PID: 4645 Comm: dhcpcd Not tainted
      6.2.0-rc6-syzkaller-00050-g9f266cca #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google
      01/12/2023
      RIP: 0010:usb_submit_urb+0x14a7/0x1880 drivers/usb/core/urb.c:411
      ...
      Call Trace:
       <TASK>
       usb_start_wait_urb+0x101/0x4b0 drivers/usb/core/message.c:58
       usb_internal_control_msg drivers/usb/core/message.c:102 [inline]
       usb_control_msg+0x320/0x4a0 drivers/usb/core/message.c:153
       __usbnet_read_cmd+0xb9/0x390 drivers/net/usb/usbnet.c:2010
       usbnet_read_cmd+0x96/0xf0 drivers/net/usb/usbnet.c:2068
       pl_vendor_req drivers/net/usb/plusb.c:60 [inline]
       pl_set_QuickLink_features drivers/net/usb/plusb.c:75 [inline]
       pl_reset+0x2f/0xf0 drivers/net/usb/plusb.c:85
       usbnet_open+0xcc/0x5d0 drivers/net/usb/usbnet.c:889
       __dev_open+0x297/0x4d0 net/core/dev.c:1417
       __dev_change_flags+0x587/0x750 net/core/dev.c:8530
       dev_change_flags+0x97/0x170 net/core/dev.c:8602
       devinet_ioctl+0x15a2/0x1d70 net/ipv4/devinet.c:1147
       inet_ioctl+0x33f/0x380 net/ipv4/af_inet.c:979
       sock_do_ioctl+0xcc/0x230 net/socket.c:1169
       sock_ioctl+0x1f8/0x680 net/socket.c:1286
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl fs/ioctl.c:856 [inline]
       __x64_sys_ioctl+0x197/0x210 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      The fix is to call usbnet_write_cmd() instead of usbnet_read_cmd() and
      remove the USB_DIR_IN flag.
      
      Reported-and-tested-by: syzbot+2a0e7abd24f1eb90ce25@syzkaller.appspotmail.com
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Fixes: 090ffa9d ("[PATCH] USB: usbnet (9/9) module for pl2301/2302 cables")
      CC: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/00000000000052099f05f3b3e298@google.com/Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      811d5811
    • Casper Andersson's avatar
      net: microchip: sparx5: fix PTP init/deinit not checking all ports · d7d94b26
      Casper Andersson authored
      Check all ports instead of just port_count ports. PTP init was only
      checking ports 0 to port_count. If the hardware ports are not mapped
      starting from 0 then they would be missed, e.g. if only ports 20-30 were
      mapped it would attempt to init ports 0-10, resulting in NULL pointers
      when attempting to timestamp. Now it will init all mapped ports.
      
      Fixes: 70dfe25c ("net: sparx5: Update extraction/injection for timestamping")
      Signed-off-by: default avatarCasper Andersson <casper.casan@gmail.com>
      Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7d94b26
    • Herton R. Krzesinski's avatar
      uapi: add missing ip/ipv6 header dependencies for linux/stddef.h · 03702d4d
      Herton R. Krzesinski authored
      Since commit 58e0be1e ("net: use struct_group to copy ip/ipv6
      header addresses"), ip and ipv6 headers started to use the __struct_group
      definition, which is defined at include/uapi/linux/stddef.h. However,
      linux/stddef.h isn't explicitly included in include/uapi/linux/{ip,ipv6}.h,
      which breaks build of xskxceiver bpf selftest if you install the uapi
      headers in the system:
      
      $ make V=1 xskxceiver -C tools/testing/selftests/bpf
      ...
      make: Entering directory '(...)/tools/testing/selftests/bpf'
      gcc -g -O0 -rdynamic -Wall -Werror (...)
      In file included from xskxceiver.c:79:
      /usr/include/linux/ip.h:103:9: error: expected specifier-qualifier-list before ‘__struct_group’
        103 |         __struct_group(/* no tag */, addrs, /* no attrs */,
            |         ^~~~~~~~~~~~~~
      ...
      
      Include the missing <linux/stddef.h> dependency in ip.h and do the
      same for the ipv6.h header.
      
      Fixes: 58e0be1e ("net: use struct_group to copy ip/ipv6 header addresses")
      Signed-off-by: default avatarHerton R. Krzesinski <herton@redhat.com>
      Reviewed-by: default avatarCarlos O'Donell <carlos@redhat.com>
      Tested-by: default avatarCarlos O'Donell <carlos@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03702d4d
    • Julian Anastasov's avatar
      neigh: make sure used and confirmed times are valid · c1d2ecdf
      Julian Anastasov authored
      Entries can linger in cache without timer for days, thanks to
      the gc_thresh1 limit. As result, without traffic, the confirmed
      time can be outdated and to appear to be in the future. Later,
      on traffic, NUD_STALE entries can switch to NUD_DELAY and start
      the timer which can see the invalid confirmed time and wrongly
      switch to NUD_REACHABLE state instead of NUD_PROBE. As result,
      timer is set many days in the future. This is more visible on
      32-bit platforms, with higher HZ value.
      
      Why this is a problem? While we expect unused entries to expire,
      such entries stay in REACHABLE state for too long, locked in
      cache. They are not expired normally, only when cache is full.
      
      Problem and the wrong state change reported by Zhang Changzhong:
      
      172.16.1.18 dev bond0 lladdr 0a:0e:0f:01:12:01 ref 1 used 350521/15994171/350520 probes 4 REACHABLE
      
      350520 seconds have elapsed since this entry was last updated, but it is
      still in the REACHABLE state (base_reachable_time_ms is 30000),
      preventing lladdr from being updated through probe.
      
      Fix it by ensuring timer is started with valid used/confirmed
      times. Considering the valid time range is LONG_MAX jiffies,
      we try not to go too much in the past while we are in
      DELAY/PROBE state. There are also places that need
      used/updated times to be validated while timer is not running.
      Reported-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
      Signed-off-by: default avatarJulian Anastasov <ja@ssi.bg>
      Tested-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1d2ecdf
  4. 04 Feb, 2023 7 commits
  5. 03 Feb, 2023 1 commit
  6. 02 Feb, 2023 16 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · edb9b8f3
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf, can and netfilter.
      
        Current release - regressions:
      
         - phy: fix null-deref in phy_attach_direct
      
         - mac802154: fix possible double free upon parsing error
      
        Previous releases - regressions:
      
         - bpf: preserve reg parent/live fields when copying range info,
           prevent mis-verification of programs as safe
      
         - ip6: fix GRE tunnels not generating IPv6 link local addresses
      
         - phy: dp83822: fix null-deref on DP83825/DP83826 devices
      
         - sctp: do not check hb_timer.expires when resetting hb_timer
      
         - eth: mtk_sock: fix SGMII configuration after phylink conversion
      
        Previous releases - always broken:
      
         - eth: xdp: execute xdp_do_flush() before napi_complete_done()
      
         - skb: do not mix page pool and page referenced frags in GRO
      
         - bpf:
            - fix a possible task gone issue with bpf_send_signal[_thread]()
            - fix an off-by-one bug in bpf_mem_cache_idx() to select the right
              cache
            - add missing btf_put to register_btf_id_dtor_kfuncs
            - sockmap: fon't let sock_map_{close,destroy,unhash} call itself
      
         - gso: fix null-deref in skb_segment_list()
      
         - mctp: purge receive queues on sk destruction
      
         - fix UaF caused by accept on already connected socket in exotic
           socket families
      
         - tls: don't treat list head as an entry in tls_is_tx_ready()
      
         - netfilter: br_netfilter: disable sabotage_in hook after first
           suppression
      
         - wwan: t7xx: fix runtime PM implementation
      
        Misc:
      
         - MAINTAINERS: spring cleanup of networking maintainers"
      
      * tag 'net-6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits)
        mtk_sgmii: enable PCS polling to allow SFP work
        net: mediatek: sgmii: fix duplex configuration
        net: mediatek: sgmii: ensure the SGMII PHY is powered down on configuration
        MAINTAINERS: update SCTP maintainers
        MAINTAINERS: ipv6: retire Hideaki Yoshifuji
        mailmap: add John Crispin's entry
        MAINTAINERS: bonding: move Veaceslav Falico to CREDITS
        net: openvswitch: fix flow memory leak in ovs_flow_cmd_new
        net: ethernet: mtk_eth_soc: disable hardware DSA untagging for second MAC
        virtio-net: Keep stop() to follow mirror sequence of open()
        selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking
        selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs
        selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided
        selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning
        can: mcp251xfd: mcp251xfd_ring_set_ringparam(): assign missing tx_obj_num_coalesce_irq
        can: isotp: split tx timer into transmission and timeout
        can: isotp: handle wait_event_interruptible() return values
        can: raw: fix CAN FD frame transmissions over CAN XL devices
        can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate
        hv_netvsc: Fix missed pagebuf entries in netvsc_dma_map/unmap()
        ...
      edb9b8f3
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-kunit-fixes-6.2-rc7' of... · e7368fd3
      Linus Torvalds authored
      Merge tag 'linux-kselftest-kunit-fixes-6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull KUnit fixes from Shuah Khan:
       "Three fixes to bugs that cause kernel crash, link error during build,
        and a third to fix kunit_test_init_section_suites() extra indirection
        issue"
      
      * tag 'linux-kselftest-kunit-fixes-6.2-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        kunit: fix kunit_test_init_section_suites(...)
        kunit: fix bug in KUNIT_EXPECT_MEMEQ
        kunit: Export kunit_running()
      e7368fd3
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 42c78a5b
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "The majority of bugfixes is once more for the NXP i.MX platform,
        addressing issue with i.MX8M (UART, watchdog and ethernet) as well as
        imx8dxl power button and the USB modem on an imx7 board.
      
        The reason that i.MX always shows up here is obviously not that they
        are more buggy than the others, but they have the most boards and are
        good about getting fixes in quickly.
      
        The other DT fixes are for the Nuvoton wpcm450 flash controller and
        the i2c mux on an ASpeed board.
      
        Lastly, there are updates to the MAINTAINERS entries for Mediatek,
        AMD/Seattle and NXP SoCs, as well as a lone code fix for error
        handling in the allwinner 'rsb' bus driver"
      
      * tag 'soc-fixes-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        ARM: dts: wpcm450: Add nuvoton,shm = <&shm> to FIU node
        MAINTAINERS: Update entry for MediaTek SoC support
        MAINTAINERS: amd: drop inactive Brijesh Singh
        ARM: dts: imx7d-smegw01: Fix USB host over-current polarity
        arm64: dts: imx8mm-verdin: Do not power down eth-phy
        MAINTAINERS: match freescale ARM64 DT directory in i.MX entry
        arm64: dts: imx8mm: Fix pad control for UART1_DTE_RX
        ARM: dts: aspeed: Fix pca9849 compatible
        arm64: dts: freescale: imx8dxl: fix sc_pwrkey's property name linux,keycode
        arm64: dts: imx8m-venice: Remove incorrect 'uart-has-rtscts'
        arm64: dts: imx8mm: Reinstate GPIO watchdog always-running property on eDM SBC
        bus: sunxi-rsb: Fix error handling in sunxi_rsb_init()
      42c78a5b
    • Linus Torvalds's avatar
      Merge tag 's390-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · addfba11
      Linus Torvalds authored
      Pull s390 fixes from Heiko Carstens:
      
       - With CONFIG_VMAP_STACK enabled it is not possible to load the s390
         specific diag288_wdt watchdog module. The reason is that a pointer to
         a string is passed to an inline assembly; this string however is
         located on the stack, while the instruction within the inline
         assembly expects a physicial address. Fix this by copying the string
         to a kmalloc'ed buffer.
      
       - The diag288_wdt watchdog module does not indicate that it accesses
         memory from an inline assembly, which it does. Add "memory" to the
         clobber list to prevent the compiler from optimizing code incorrectly
         away.
      
       - Pass size of the uncompressed kernel image to __decompress() call.
         Otherwise the kernel image decompressor may corrupt/overwrite an
         initrd. This was reported to happen on s390 after commit 2aa14b1a
         ("zstd: import usptream v1.5.2").
      
      * tag 's390-6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/decompressor: specify __decompress() buf len to avoid overflow
        watchdog: diag288_wdt: fix __diag288() inline assembly
        watchdog: diag288_wdt: do not use stack buffers for hardware data
      addfba11
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.2-4' of... · 870bb765
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fixes from Hans de Goede:
       "A set of AMD PMF fixes + a few other small fixes"
      
      * tag 'platform-drivers-x86-v6.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match
        platform/x86: thinkpad_acpi: Fix thinklight LED brightness returning 255
        platform/x86/amd: pmc: add CONFIG_SERIO dependency
        platform/x86/amd/pmf: Ensure mutexes are initialized before use
        platform/x86/amd/pmf: Fix to update SPS thermals when power supply change
        platform/x86/amd/pmf: Fix to update SPS default pprof thermals
        platform/x86/amd/pmf: update to auto-mode limits only after AMT event
        platform/x86/amd/pmf: Add helper routine to check pprof is balanced
        platform/x86/amd/pmf: Add helper routine to update SPS thermals
      870bb765
    • Jakub Kicinski's avatar
      Merge branch 'fixes-for-mtk_eth_soc' · 9983a2c9
      Jakub Kicinski authored
      Bjørn Mork says:
      
      ====================
      Fix mtk_eth_soc sgmii configuration.
      
      This has been tested on a MT7986 with a Maxlinear GPY211C phy
      permanently attached to the second SoC mac.
      ====================
      
      Link: https://lore.kernel.org/r/20230201182331.943411-1-bjorn@mork.noSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9983a2c9
    • Alexander Couzens's avatar
      mtk_sgmii: enable PCS polling to allow SFP work · 3337a6e0
      Alexander Couzens authored
      Currently there is no IRQ handling (even the SGMII supports it).
      Enable polling to support SFP ports.
      
      Fixes: 14a44ab0 ("net: mtk_eth_soc: partially convert to phylink_pcs")
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarAlexander Couzens <lynxis@fe80.eu>
      [ bmork: changed "1" => "true" ]
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Acked-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Tested-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3337a6e0
    • Bjørn Mork's avatar
      net: mediatek: sgmii: fix duplex configuration · 9d326371
      Bjørn Mork authored
      The logic of the duplex bit is inverted.  Setting it means half
      duplex, not full duplex.
      
      Fix and rename macro to avoid confusion.
      
      Fixes: 7e538372 ("net: ethernet: mediatek: Re-add support SGMII")
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Acked-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Tested-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9d326371
    • Alexander Couzens's avatar
      net: mediatek: sgmii: ensure the SGMII PHY is powered down on configuration · 7ff82416
      Alexander Couzens authored
      The code expect the PHY to be in power down which is only true after reset.
      Allow changes of the SGMII parameters more than once.
      
      Only power down when reconfiguring to avoid bouncing the link when there's
      no reason to - based on code from Russell King.
      
      There are cases when the SGMII_PHYA_PWD register contains 0x9 which
      prevents SGMII from working. The SGMII still shows link but no traffic
      can flow. Writing 0x0 to the PHYA_PWD register fix the issue. 0x0 was
      taken from a good working state of the SGMII interface.
      
      Fixes: 42c03844 ("net-next: mediatek: add support for MediaTek MT7622 SoC")
      Suggested-by: default avatarRussell King (Oracle) <linux@armlinux.org.uk>
      Signed-off-by: default avatarAlexander Couzens <lynxis@fe80.eu>
      [ bmork: rebased and squashed into one patch ]
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Acked-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Tested-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7ff82416
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-6.2-20230202' of... · b0de13d3
      Jakub Kicinski authored
      Merge tag 'linux-can-fixes-for-6.2-20230202' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      can 2023-02-02
      
      The first patch is by Ziyang Xuan and removes a errant WARN_ON_ONCE()
      in the CAN J1939 protocol.
      
      The next 3 patches are by Oliver Hartkopp. The first 2 target the CAN
      ISO-TP protocol and fix the state machine with respect to signals and
      a regression found by the syzbot.
      
      The last patch is by me an missing assignment during the ethtool ring
      configuration callback.
      
      * tag 'linux-can-fixes-for-6.2-20230202' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: mcp251xfd: mcp251xfd_ring_set_ringparam(): assign missing tx_obj_num_coalesce_irq
        can: isotp: split tx timer into transmission and timeout
        can: isotp: handle wait_event_interruptible() return values
        can: raw: fix CAN FD frame transmissions over CAN XL devices
        can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate
      ====================
      
      Link: https://lore.kernel.org/r/20230202094135.2293939-1-mkl@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b0de13d3
    • Jakub Kicinski's avatar
      Merge branch 'maintainers-spring-refresh-of-networking-maintainers' · 4b6e135e
      Jakub Kicinski authored
      Jakub Kicinski says:
      
      ====================
      MAINTAINERS: spring refresh of networking maintainers
      
      Use Jon Corbet's script for generating statistics about maintainer
      coverage to identify inactive maintainers of relatively active code.
      Move them to CREDITS.
      ====================
      
      Link: https://lore.kernel.org/r/20230201182014.2362044-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4b6e135e
    • Jakub Kicinski's avatar
      MAINTAINERS: update SCTP maintainers · cd101f40
      Jakub Kicinski authored
      Vlad has stepped away from SCTP related duties.
      Move him to CREDITS and add Xin Long.
      
      Subsystem SCTP PROTOCOL
        Changes 237 / 629 (37%)
        Last activity: 2022-12-12
        Vlad Yasevich <vyasevich@gmail.com>:
        Neil Horman <nhorman@tuxdriver.com>:
          Author 20a785aa 2020-05-19 00:00:00 4
          Tags 20a785aa 2020-05-19 00:00:00 84
        Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>:
          Author 557fb586 2021-07-28 00:00:00 41
          Tags da05cecc 2022-12-12 00:00:00 197
        Top reviewers:
          [15]: lucien.xin@gmail.com
        INACTIVE MAINTAINER Vlad Yasevich <vyasevich@gmail.com>
      Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cd101f40
    • Jakub Kicinski's avatar
      MAINTAINERS: ipv6: retire Hideaki Yoshifuji · c71a70c2
      Jakub Kicinski authored
      We very rarely hear from Hideaki Yoshifuji and the IPv4/IPv6
      entry covers a lot of code. Asking people to CC someone who
      rarely responds feels wrong.
      
      Note that Hideaki Yoshifuji already has an entry in CREDITS
      for IPv6 so not adding another one.
      
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c71a70c2
    • Jakub Kicinski's avatar
      mailmap: add John Crispin's entry · a3596562
      Jakub Kicinski authored
      John has not been CCed on some of the fixes which perhaps resulted
      in the lack of review tags:
      
      Subsystem MEDIATEK ETHERNET DRIVER
        Changes 50 / 295 (16%)
        Last activity: 2023-01-17
        Felix Fietkau <nbd@nbd.name>:
          Author 8bd8dcc5 2022-11-18 00:00:00 33
          Tags 8bd8dcc5 2022-11-18 00:00:00 38
        John Crispin <john@phrozen.org>:
        Sean Wang <sean.wang@mediatek.com>:
          Author 880c2d4b 2019-06-03 00:00:00 7
          Tags a5d75538 2020-04-07 00:00:00 10
        Mark Lee <Mark-MC.Lee@mediatek.com>:
          Author 8d66a818 2019-11-14 00:00:00 4
          Tags 8d66a818 2019-11-14 00:00:00 4
        Lorenzo Bianconi <lorenzo@kernel.org>:
          Author 08a764a7 2023-01-17 00:00:00 68
          Tags 08a764a7 2023-01-17 00:00:00 74
        Top reviewers:
          [12]: leonro@nvidia.com
          [6]: f.fainelli@gmail.com
          [6]: andrew@lunn.ch
        INACTIVE MAINTAINER John Crispin <john@phrozen.org>
      
      map his old address to the up to date one.
      Acked-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a3596562
    • Jakub Kicinski's avatar
      MAINTAINERS: bonding: move Veaceslav Falico to CREDITS · 57b24f8c
      Jakub Kicinski authored
      Veaceslav has stepped away from netdev:
      
      Subsystem BONDING DRIVER
        Changes 96 / 319 (30%)
        Last activity: 2022-12-01
        Jay Vosburgh <j.vosburgh@gmail.com>:
          Author 4f5d33f4 2022-08-11 00:00:00 3
          Tags e5214f36 2022-12-01 00:00:00 48
        Veaceslav Falico <vfalico@gmail.com>:
        Andy Gospodarek <andy@greyhouse.net>:
          Tags 47f70626 2019-02-24 00:00:00 4
        Top reviewers:
          [42]: jay.vosburgh@canonical.com
          [18]: jiri@nvidia.com
          [10]: jtoppins@redhat.com
        INACTIVE MAINTAINER Veaceslav Falico <vfalico@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      57b24f8c
    • Fedor Pchelkin's avatar
      net: openvswitch: fix flow memory leak in ovs_flow_cmd_new · 0c598aed
      Fedor Pchelkin authored
      Syzkaller reports a memory leak of new_flow in ovs_flow_cmd_new() as it is
      not freed when an allocation of a key fails.
      
      BUG: memory leak
      unreferenced object 0xffff888116668000 (size 632):
        comm "syz-executor231", pid 1090, jiffies 4294844701 (age 18.871s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000defa3494>] kmem_cache_zalloc include/linux/slab.h:654 [inline]
          [<00000000defa3494>] ovs_flow_alloc+0x19/0x180 net/openvswitch/flow_table.c:77
          [<00000000c67d8873>] ovs_flow_cmd_new+0x1de/0xd40 net/openvswitch/datapath.c:957
          [<0000000010a539a8>] genl_family_rcv_msg_doit+0x22d/0x330 net/netlink/genetlink.c:739
          [<00000000dff3302d>] genl_family_rcv_msg net/netlink/genetlink.c:783 [inline]
          [<00000000dff3302d>] genl_rcv_msg+0x328/0x590 net/netlink/genetlink.c:800
          [<000000000286dd87>] netlink_rcv_skb+0x153/0x430 net/netlink/af_netlink.c:2515
          [<0000000061fed410>] genl_rcv+0x24/0x40 net/netlink/genetlink.c:811
          [<000000009dc0f111>] netlink_unicast_kernel net/netlink/af_netlink.c:1313 [inline]
          [<000000009dc0f111>] netlink_unicast+0x545/0x7f0 net/netlink/af_netlink.c:1339
          [<000000004a5ee816>] netlink_sendmsg+0x8e7/0xde0 net/netlink/af_netlink.c:1934
          [<00000000482b476f>] sock_sendmsg_nosec net/socket.c:651 [inline]
          [<00000000482b476f>] sock_sendmsg+0x152/0x190 net/socket.c:671
          [<00000000698574ba>] ____sys_sendmsg+0x70a/0x870 net/socket.c:2356
          [<00000000d28d9e11>] ___sys_sendmsg+0xf3/0x170 net/socket.c:2410
          [<0000000083ba9120>] __sys_sendmsg+0xe5/0x1b0 net/socket.c:2439
          [<00000000c00628f8>] do_syscall_64+0x30/0x40 arch/x86/entry/common.c:46
          [<000000004abfdcf4>] entry_SYSCALL_64_after_hwframe+0x61/0xc6
      
      To fix this the patch rearranges the goto labels to reflect the order of
      object allocations and adds appropriate goto statements on the error
      paths.
      
      Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
      
      Fixes: 68bb1010 ("openvswitch: Fix flow lookup to use unmasked key")
      Signed-off-by: default avatarFedor Pchelkin <pchelkin@ispras.ru>
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Acked-by: default avatarEelco Chaudron <echaudro@redhat.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
      Link: https://lore.kernel.org/r/20230201210218.361970-1-pchelkin@ispras.ruSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0c598aed