1. 24 Mar, 2021 4 commits
  2. 23 Mar, 2021 4 commits
    • Vladimir Oltean's avatar
      net: bridge: don't notify switchdev for local FDB addresses · 6ab4c311
      Vladimir Oltean authored
      As explained in this discussion:
      https://lore.kernel.org/netdev/20210117193009.io3nungdwuzmo5f7@skbuf/
      
      the switchdev notifiers for FDB entries managed to have a zero-day bug.
      The bridge would not say that this entry is local:
      
      ip link add br0 type bridge
      ip link set swp0 master br0
      bridge fdb add dev swp0 00:01:02:03:04:05 master local
      
      and the switchdev driver would be more than happy to offload it as a
      normal static FDB entry. This is despite the fact that 'local' and
      non-'local' entries have completely opposite directions: a local entry
      is locally terminated and not forwarded, whereas a static entry is
      forwarded and not locally terminated. So, for example, DSA would install
      this entry on swp0 instead of installing it on the CPU port as it should.
      
      There is an even sadder part, which is that the 'local' flag is implicit
      if 'static' is not specified, meaning that this command produces the
      same result of adding a 'local' entry:
      
      bridge fdb add dev swp0 00:01:02:03:04:05 master
      
      I've updated the man pages for 'bridge', and after reading it now, it
      should be pretty clear to any user that the commands above were broken
      and should have never resulted in the 00:01:02:03:04:05 address being
      forwarded (this behavior is coherent with non-switchdev interfaces):
      https://patchwork.kernel.org/project/netdevbpf/cover/20210211104502.2081443-1-olteanv@gmail.com/
      If you're a user reading this and this is what you want, just use:
      
      bridge fdb add dev swp0 00:01:02:03:04:05 master static
      
      Because switchdev should have given drivers the means from day one to
      classify FDB entries as local/non-local, but didn't, it means that all
      drivers are currently broken. So we can just as well omit the switchdev
      notifications for local FDB entries, which is exactly what this patch
      does to close the bug in stable trees. For further development work
      where drivers might want to trap the local FDB entries to the host, we
      can add a 'bool is_local' to br_switchdev_fdb_call_notifiers(), and
      selectively make drivers act upon that bit, while all the others ignore
      those entries if the 'is_local' bit is set.
      
      Fixes: 6b26b51b ("net: bridge: Add support for notifying devices about FDB add/del")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6ab4c311
    • Marcelo Ricardo Leitner's avatar
      net/sched: act_ct: clear post_ct if doing ct_clear · 8ca1b090
      Marcelo Ricardo Leitner authored
      Invalid detection works with two distinct moments: act_ct tries to find
      a conntrack entry and set post_ct true, indicating that that was
      attempted. Then, when flow dissector tries to dissect CT info and no
      entry is there, it knows that it was tried and no entry was found, and
      synthesizes/sets
                        key->ct_state = TCA_FLOWER_KEY_CT_FLAGS_TRACKED |
                                        TCA_FLOWER_KEY_CT_FLAGS_INVALID;
      mimicing what OVS does.
      
      OVS has this a bit more streamlined, as it recomputes the key after
      trying to find a conntrack entry for it.
      
      Issue here is, when we have 'tc action ct clear', it didn't clear
      post_ct, causing a subsequent match on 'ct_state -trk' to fail, due to
      the above. The fix, thus, is to clear it.
      
      Reproducer rules:
      tc filter add dev enp130s0f0np0_0 ingress prio 1 chain 0 \
      	protocol ip flower ip_proto tcp ct_state -trk \
      	action ct zone 1 pipe \
      	action goto chain 2
      tc filter add dev enp130s0f0np0_0 ingress prio 1 chain 2 \
      	protocol ip flower \
      	action ct clear pipe \
      	action goto chain 4
      tc filter add dev enp130s0f0np0_0 ingress prio 1 chain 4 \
      	protocol ip flower ct_state -trk \
      	action mirred egress redirect dev enp130s0f1np1_0
      
      With the fix, the 3rd rule matches, like it does with OVS kernel
      datapath.
      
      Fixes: 7baf2429 ("net/sched: cls_flower add CT_FLAGS_INVALID flag support")
      Signed-off-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Reviewed-by: default avatarwenxu <wenxu@ucloud.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ca1b090
    • George McCollister's avatar
      net: dsa: don't assign an error value to tag_ops · e0c755a4
      George McCollister authored
      Use a temporary variable to hold the return value from
      dsa_tag_driver_get() instead of assigning it to dst->tag_ops. Leaving
      an error value in dst->tag_ops can result in deferencing an invalid
      pointer when a deferred switch configuration happens later.
      
      Fixes: 357f203b ("net: dsa: keep a copy of the tagging protocol in the DSA switch tree")
      Signed-off-by: default avatarGeorge McCollister <george.mccollister@gmail.com>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e0c755a4
    • David S. Miller's avatar
      Merge tag 'mlx5-fixes-2021-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 8fb16e80
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5 fixes 2021-03-22
      
      This series introduces some fixes to mlx5 driver.
      Please pull and let me know if there is any problem.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fb16e80
  3. 22 Mar, 2021 9 commits
  4. 21 Mar, 2021 5 commits
    • Bhaskar Chowdhury's avatar
      docs: networking: Fix a typo · 87d77e59
      Bhaskar Chowdhury authored
      s/subsytem/subsystem/
      Signed-off-by: default avatarBhaskar Chowdhury <unixbhaskar@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      87d77e59
    • Heiner Kallweit's avatar
      r8169: fix DMA being used after buffer free if WoL is enabled · f658b909
      Heiner Kallweit authored
      IOMMU errors have been reported if WoL is enabled and interface is
      brought down. It turned out that the network chip triggers DMA
      transfers after the DMA buffers have been freed. For WoL to work we
      need to leave rx enabled, therefore simply stop the chip from being
      a DMA busmaster.
      
      Fixes: 567ca57f ("r8169: add rtl8169_up")
      Tested-by: default avatarPaul Blazejowski <paulb@blazebox.homeip.net>
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f658b909
    • David S. Miller's avatar
      Merge tag 'linux-can-fixes-for-5.12-20210320' of... · 49371a8a
      David S. Miller authored
      Merge tag 'linux-can-fixes-for-5.12-20210320' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      pull-request: can 2021-03-20
      
      this is a pull request of 2 patches for net/master.
      
      The first patch is by Oliver Hartkopp. He fixes the TX-path in the
      ISO-TP protocol by properly initializing the outgoing CAN frames.
      
      The second patch is by me and reverts a patch from my previous pull
      request which added MODULE_SUPPORTED_DEVICE to the peak_usb driver. In
      the mean time in Linus's tree the entirely MODULE_SUPPORTED_DEVICE was
      removed. So this reverts the adding of the new MODULE_SUPPORTED_DEVICE
      to avoid the merge conflict.
      
      If you prefer to resolve the merge conflict by hand, I'll send a new
      pull request without that patch.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49371a8a
    • David S. Miller's avatar
      Merge branch 'pa-fox-validation' · a05b0c8c
      David S. Miller authored
      Alex Elder says:
      
      ====================
      ipa: fix validation
      
      There is sanity checking code in the IPA driver that's meant to be
      enabled only during development.  This allows the driver to make
      certain assumptions, but not have to verify those assumptions are
      true at (operational) runtime.  This code is built conditional on
      IPA_VALIDATION, set (if desired) inside the IPA makefile.
      
      Unfortunately, this validation code has some errors.  First, there
      are some mismatched arguments supplied to some dev_err() calls in
      ipa_cmd_table_valid() and ipa_cmd_header_valid(), and these are
      exposed if validation is enabled.  Second, the tag that enables
      this conditional code isn't used consistently (it's IPA_VALIDATE
      in some spots and IPA_VALIDATION in others).
      
      This series fixes those two problems with the conditional validation
      code.
      
      Version 2 removes the two patches that introduced ipa_assert().  It
      also modifies the description in the first patch so that it mentions
      the changes made to ipa_cmd_table_valid().
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a05b0c8c
    • Alex Elder's avatar
      net: ipa: fix init header command validation · b4afd4b9
      Alex Elder authored
      We use ipa_cmd_header_valid() to ensure certain values we will
      program into hardware are within range, well in advance of when we
      actually program them.  This way we avoid having to check for errors
      when we actually program the hardware.
      
      Unfortunately the dev_err() call for a bad offset value does not
      supply the arguments to match the format specifiers properly.
      Fix this.
      
      There was also supposed to be a check to ensure the size to be
      programmed fits in the field that holds it.  Add this missing check.
      
      Rearrange the way we ensure the header table fits in overall IPA
      memory range.
      
      Finally, update ipa_cmd_table_valid() so the format of messages
      printed for errors matches what's done in ipa_cmd_header_valid().
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4afd4b9
  5. 20 Mar, 2021 4 commits
  6. 19 Mar, 2021 14 commits