1. 26 Jan, 2021 14 commits
    • Paul Blakey's avatar
      net/mlx5e: Fix CT rule + encap slow path offload and deletion · 89e39467
      Paul Blakey authored
      Currently, if a neighbour isn't valid when offloading tunnel encap rules,
      we offload the original match and replace the original action with
      "goto slow path" action. For this we use a temporary flow attribute based
      on the original flow attribute and then change the action. Flow flags,
      which among those is the CT flag, are still shared for the slow path rule
      offload, so we end up parsing this flow as a CT + goto slow path rule.
      
      Besides being unnecessary, CT action offload saves extra information in
      the passed flow attribute, such as created ct_flow and mod_hdr, which
      is lost onces the temporary flow attribute is freed.
      
      When a neigh is updated and is valid, we offload the original CT rule
      with original CT action, which again creates a ct_flow and mod_hdr
      and saves it in the flow's original attribute. Then we delete the slow
      path rule with a temporary flow attribute based on original updated
      flow attribute, and we free the relevant ct_flow and mod_hdr.
      
      Then when tc deletes this flow, we try to free the ct_flow and mod_hdr
      on the flow's attribute again.
      
      To fix the issue, skip all furture proccesing (CT/Sample/Split rules)
      in offload/unoffload of slow path rules.
      
      Call trace:
      [  758.850525] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000218
      [  758.952987] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [  758.964170] Modules linked in: act_csum(E) act_pedit(E) act_tunnel_key(E) act_ct(E) nf_flow_table(E) xt_nat(E) ip6table_filter(E) ip6table_nat(E) xt_comment(E) ip6_tables(E) xt_conntrack(E) xt_MASQUERADE(E) nf_conntrack_netlink(E) xt_addrtype(E) iptable_filter(E) iptable_nat(E) bpfilter(E) br_netfilter(E) bridge(E) stp(E) llc(E) xfrm_user(E) overlay(E) act_mirred(E) act_skbedit(E) rdma_ucm(OE) rdma_cm(OE) iw_cm(OE) ib_ipoib(OE) ib_cm(OE) ib_umad(OE) esp6_offload(E) esp6(E) esp4_offload(E) esp4(E) xfrm_algo(E) mlx5_ib(OE) ib_uverbs(OE) geneve(E) ip6_udp_tunnel(E) udp_tunnel(E) nfnetlink_cttimeout(E) nfnetlink(E) mlx5_core(OE) act_gact(E) cls_flower(E) sch_ingress(E) openvswitch(E) nsh(E) nf_conncount(E) nf_nat(E) mlxfw(OE) psample(E) nf_conntrack(E) nf_defrag_ipv4(E) vfio_mdev(E) mdev(E) ib_core(OE) mlx_compat(OE) crct10dif_ce(E) uio_pdrv_genirq(E) uio(E) i2c_mlx(E) mlxbf_pmc(E) sbsa_gwdt(E) mlxbf_gige(E) gpio_mlxbf2(E) mlxbf_pka(E) mlx_trio(E) mlx_bootctl(E) bluefield_edac(E) knem(O)
      [  758.964225]  ip_tables(E) mlxbf_tmfifo(E) ipv6(E) crc_ccitt(E) nf_defrag_ipv6(E)
      [  759.154186] CPU: 5 PID: 122 Comm: kworker/u16:1 Tainted: G           OE     5.4.60-mlnx.52.gde81e85 #1
      [  759.172870] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS BlueField:3.5.0-2-gc1b5d64 Jan  4 2021
      [  759.195466] Workqueue: mlx5e mlx5e_rep_neigh_update [mlx5_core]
      [  759.207344] pstate: a0000005 (NzCv daif -PAN -UAO)
      [  759.217003] pc : mlx5_del_flow_rules+0x5c/0x160 [mlx5_core]
      [  759.228229] lr : mlx5_del_flow_rules+0x34/0x160 [mlx5_core]
      [  759.405858] Call trace:
      [  759.410804]  mlx5_del_flow_rules+0x5c/0x160 [mlx5_core]
      [  759.421337]  __mlx5_eswitch_del_rule.isra.43+0x5c/0x1c8 [mlx5_core]
      [  759.433963]  mlx5_eswitch_del_offloaded_rule_ct+0x34/0x40 [mlx5_core]
      [  759.446942]  mlx5_tc_rule_delete_ct+0x68/0x74 [mlx5_core]
      [  759.457821]  mlx5_tc_ct_delete_flow+0x160/0x21c [mlx5_core]
      [  759.469051]  mlx5e_tc_unoffload_fdb_rules+0x158/0x168 [mlx5_core]
      [  759.481325]  mlx5e_tc_encap_flows_del+0x140/0x26c [mlx5_core]
      [  759.492901]  mlx5e_rep_update_flows+0x11c/0x1ec [mlx5_core]
      [  759.504127]  mlx5e_rep_neigh_update+0x160/0x200 [mlx5_core]
      [  759.515314]  process_one_work+0x178/0x400
      [  759.523350]  worker_thread+0x58/0x3e8
      [  759.530685]  kthread+0x100/0x12c
      [  759.537152]  ret_from_fork+0x10/0x18
      [  759.544320] Code: 97ffef55 51000673 3100067f 54ffff41 (b9421ab3)
      [  759.556548] ---[ end trace fab818bb1085832d ]---
      
      Fixes: 4c3844d9 ("net/mlx5e: CT: Introduce connection tracking")
      Signed-off-by: default avatarPaul Blakey <paulb@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      89e39467
    • Maor Dickman's avatar
      net/mlx5e: Disable hw-tc-offload when MLX5_CLS_ACT config is disabled · 156878d0
      Maor Dickman authored
      The cited commit introduce new CONFIG_MLX5_CLS_ACT kconfig variable
      to control compilation of TC hardware offloads implementation.
      When this configuration is disabled the driver is still wrongly
      reports in ethtool that hw-tc-offload is supported.
      
      Fixed by reporting hw-tc-offload is supported only when
      CONFIG_MLX5_CLS_ACT is enabled.
      
      Fixes: d956873f ("net/mlx5e: Introduce kconfig var for TC support")
      Signed-off-by: default avatarMaor Dickman <maord@nvidia.com>
      Reviewed-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      156878d0
    • Daniel Jurgens's avatar
      net/mlx5: Maintain separate page trees for ECPF and PF functions · 0aa12847
      Daniel Jurgens authored
      Pages for the host PF and ECPF were stored in the same tree, so the ECPF
      pages were being freed along with the host PF's when the host driver
      unloaded.
      
      Combine the function ID and ECPF flag to use as an index into the
      x-array containing the trees to get a different tree for the host PF and
      ECPF.
      
      Fixes: c6168161 ("net/mlx5: Add support for release all pages event")
      Signed-off-by: default avatarDaniel Jurgens <danielj@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      0aa12847
    • Maxim Mikityanskiy's avatar
      net/mlx5e: Fix IPSEC stats · 45c9a308
      Maxim Mikityanskiy authored
      When IPSEC offload isn't active, the number of stats is not zero, but
      the strings are not filled, leading to exposing stats with empty names.
      Fix this by using the same condition for NUM_STATS and FILL_STRS.
      
      Fixes: 0aab3e1b ("net/mlx5e: IPSec, Expose IPsec HW stat only for supporting HW")
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@mellanox.com>
      Reviewed-by: default avatarRaed Salem <raeds@nvidia.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      45c9a308
    • Maor Dickman's avatar
      net/mlx5e: Reduce tc unsupported key print level · 48470a90
      Maor Dickman authored
      "Unsupported key used:" appears in kernel log when flows with
      unsupported key are used, arp fields for example.
      
      OpenVSwitch was changed to match on arp fields by default that
      caused this warning to appear in kernel log for every arp rule, which
      can be a lot.
      
      Fix by lowering print level from warning to debug.
      
      Fixes: e3a2b7ed ("net/mlx5e: Support offload cls_flower with drop action")
      Signed-off-by: default avatarMaor Dickman <maord@nvidia.com>
      Reviewed-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      48470a90
    • Pan Bian's avatar
      net/mlx5e: free page before return · 258ed19f
      Pan Bian authored
      Instead of directly return, goto the error handling label to free
      allocated page.
      
      Fixes: 5f29458b ("net/mlx5e: Support dump callback in TX reporter")
      Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      258ed19f
    • Parav Pandit's avatar
      net/mlx5e: E-switch, Fix rate calculation for overflow · 1fe3e316
      Parav Pandit authored
      rate_bytes_ps is a 64-bit field. It passed as 32-bit field to
      apply_police_params(). Due to this when police rate is higher
      than 4Gbps, 32-bit calculation ignores the carry. This results
      in incorrect rate configurationn the device.
      
      Fix it by performing 64-bit calculation.
      
      Fixes: fcb64c0f ("net/mlx5: E-Switch, add ingress rate support")
      Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
      Reviewed-by: default avatarEli Cohen <elic@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      1fe3e316
    • Roi Dayan's avatar
      net/mlx5: Fix memory leak on flow table creation error flow · 487c6ef8
      Roi Dayan authored
      When we create the ft object we also init rhltable in ft->fgs_hash.
      So in error flow before kfree of ft we need to destroy that rhltable.
      
      Fixes: 693c6883 ("net/mlx5: Add hash table for flow groups in flow table")
      Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
      Reviewed-by: default avatarMaor Dickman <maord@nvidia.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
      487c6ef8
    • Jakub Kicinski's avatar
      Merge tag 'mac80211-for-net-2021-01-26' of... · c5e9e8d4
      Jakub Kicinski authored
      Merge tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      Johannes Berg says:
      
      ====================
      A couple of fixes:
       * fix 160 MHz channel switch in mac80211
       * fix a staging driver to not deadlock due to some
         recent cfg80211 changes
       * fix NULL-ptr deref if cfg80211 returns -EINPROGRESS
         to wext (syzbot)
       * pause TX in mac80211 in type change to prevent crashes
         (syzbot)
      
      * tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211:
        staging: rtl8723bs: fix wireless regulatory API misuse
        mac80211: pause TX while changing interface type
        wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
        mac80211: 160MHz with extended NSS BW in CSA
      ====================
      
      Link: https://lore.kernel.org/r/20210126130529.75225-1-johannes@sipsolutions.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c5e9e8d4
    • Jakub Kicinski's avatar
      Merge tag 'wireless-drivers-2021-01-26' of... · db22ce68
      Jakub Kicinski authored
      Merge tag 'wireless-drivers-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.11
      
      Second set of fixes for v5.11. Like in last time we again have more
      fixes than usual Actually a bit too much for my liking in this state
      of the cycle, but due to unrelated challenges I was only able to
      submit them now.
      
      We have few important crash fixes, iwlwifi modifying read-only data
      being the most reported issue, and also smaller fixes to iwlwifi.
      
      mt76
       * fix a clang warning about enum usage
       * fix rx buffer refcounting crash
      
      mt7601u
       * fix rx buffer refcounting crash
       * fix crash when unbplugging the device
      
      iwlwifi
       * fix a crash where we were modifying read-only firmware data
       * lots of smaller fixes all over the driver
      
      * tag 'wireless-drivers-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers: (24 commits)
        mt7601u: fix kernel crash unplugging the device
        iwlwifi: queue: bail out on invalid freeing
        iwlwifi: mvm: guard against device removal in reprobe
        iwlwifi: Fix IWL_SUBDEVICE_NO_160 macro to use the correct bit.
        iwlwifi: mvm: clear IN_D3 after wowlan status cmd
        iwlwifi: pcie: add rules to match Qu with Hr2
        iwlwifi: mvm: invalidate IDs of internal stations at mvm start
        iwlwifi: mvm: fix the return type for DSM functions 1 and 2
        iwlwifi: pcie: reschedule in long-running memory reads
        iwlwifi: pcie: use jiffies for memory read spin time limit
        iwlwifi: pcie: fix context info memory leak
        iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap
        iwlwifi: pcie: set LTR on more devices
        iwlwifi: queue: don't crash if txq->entries is NULL
        iwlwifi: fix the NMI flow for old devices
        iwlwifi: pnvm: don't try to load after failures
        iwlwifi: pnvm: don't skip everything when not reloading
        iwlwifi: pcie: avoid potential PNVM leaks
        iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time()
        iwlwifi: mvm: skip power command when unbinding vif during CSA
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20210126092202.6A367C433CA@smtp.codeaurora.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      db22ce68
    • Eric Dumazet's avatar
      iwlwifi: provide gso_type to GSO packets · 81a86e1b
      Eric Dumazet authored
      net/core/tso.c got recent support for USO, and this broke iwlfifi
      because the driver implemented a limited form of GSO.
      
      Providing ->gso_type allows for skb_is_gso_tcp() to provide
      a correct result.
      
      Fixes: 3d5b459b ("net: tso: add UDP segmentation support")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarBen Greear <greearb@candelatech.com>
      Tested-by: default avatarBen Greear <greearb@candelatech.com>
      Cc: Luca Coelho <luciano.coelho@intel.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=209913
      Link: https://lore.kernel.org/r/20210125150949.619309-1-eric.dumazet@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      81a86e1b
    • Johannes Berg's avatar
      staging: rtl8723bs: fix wireless regulatory API misuse · 81f153fa
      Johannes Berg authored
      This code ends up calling wiphy_apply_custom_regulatory(), for which
      we document that it should be called before wiphy_register(). This
      driver doesn't do that, but calls it from ndo_open() with the RTNL
      held, which caused deadlocks.
      
      Since the driver just registers static regdomain data and then the
      notifier applies the channel changes if any, there's no reason for
      it to call this in ndo_open(), move it earlier to fix the deadlock.
      Reported-and-tested-by: default avatarHans de Goede <hdegoede@redhat.com>
      Fixes: 51d62f2f ("cfg80211: Save the regulatory domain with a lock")
      Link: https://lore.kernel.org/r/20210126115409.d5fd6f8fe042.Ib5823a6feb2e2aa01ca1a565d2505367f38ad246@changeidAcked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      81f153fa
    • Johannes Berg's avatar
      mac80211: pause TX while changing interface type · 054c9939
      Johannes Berg authored
      syzbot reported a crash that happened when changing the interface
      type around a lot, and while it might have been easy to fix just
      the symptom there, a little deeper investigation found that really
      the reason is that we allowed packets to be transmitted while in
      the middle of changing the interface type.
      
      Disallow TX by stopping the queues while changing the type.
      
      Fixes: 34d4bc4d ("mac80211: support runtime interface type changes")
      Reported-by: syzbot+d7a3b15976bf7de2238a@syzkaller.appspotmail.com
      Link: https://lore.kernel.org/r/20210122171115.b321f98f4d4f.I6997841933c17b093535c31d29355be3c0c39628@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      054c9939
    • Johannes Berg's avatar
      wext: fix NULL-ptr-dereference with cfg80211's lack of commit() · 51225651
      Johannes Berg authored
      Since cfg80211 doesn't implement commit, we never really cared about
      that code there (and it's configured out w/o CONFIG_WIRELESS_EXT).
      After all, since it has no commit, it shouldn't return -EIWCOMMIT to
      indicate commit is needed.
      
      However, EIWCOMMIT is actually an alias for EINPROGRESS, which _can_
      happen if e.g. we try to change the frequency but we're already in
      the process of connecting to some network, and drivers could return
      that value (or even cfg80211 itself might).
      
      This then causes us to crash because dev->wireless_handlers is NULL
      but we try to check dev->wireless_handlers->standard[0].
      
      Fix this by also checking dev->wireless_handlers. Also simplify the
      code a little bit.
      
      Cc: stable@vger.kernel.org
      Reported-by: syzbot+444248c79e117bc99f46@syzkaller.appspotmail.com
      Reported-by: syzbot+8b2a88a09653d4084179@syzkaller.appspotmail.com
      Link: https://lore.kernel.org/r/20210121171621.2076e4a37d5a.I5d9c72220fe7bb133fb718751da0180a57ecba4e@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      51225651
  2. 25 Jan, 2021 21 commits
  3. 24 Jan, 2021 2 commits
  4. 23 Jan, 2021 3 commits