1. Jul 06, 2022
  2. Jul 05, 2022
    • Paolo Abeni's avatar
      Merge branch 'fix-bridge_vlan_aware-sh-and-bridge_vlan_unaware-sh-with-iff_unicast_flt' · 029cc096
      Paolo Abeni authored
      Vladimir Oltean says:
      
      ====================
      Fix bridge_vlan_aware.sh and bridge_vlan_unaware.sh with IFF_UNICAST_FLT
      
      Make sure that h1 and h2 don't drop packets with a random MAC DA, which
      otherwise confuses these selftests. Also, fix an incorrect error message
      found during those failures.
      ====================
      
      Link: https://lore.kernel.org/r/20220703073626.937785-1-vladimir.oltean@nxp.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      029cc096
    • Vladimir Oltean's avatar
      selftests: forwarding: fix error message in learning_test · 83844aac
      Vladimir Oltean authored
      When packets are not received, they aren't received on $host1_if, so the
      message talking about the second host not receiving them is incorrect.
      Fix it.
      
      Fixes: d4deb014
      
       ("selftests: forwarding: Add a test for FDB learning")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      83844aac
    • Vladimir Oltean's avatar
      selftests: forwarding: fix learning_test when h1 supports IFF_UNICAST_FLT · 1a635d3e
      Vladimir Oltean authored
      The first host interface has by default no interest in receiving packets
      MAC DA de:ad:be:ef:13:37, so it might drop them before they hit the tc
      filter and this might confuse the selftest.
      
      Enable promiscuous mode such that the filter properly counts received
      packets.
      
      Fixes: d4deb014
      
       ("selftests: forwarding: Add a test for FDB learning")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      1a635d3e
    • Vladimir Oltean's avatar
      selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT · b8e629b0
      Vladimir Oltean authored
      As mentioned in the blamed commit, flood_unicast_test() works by
      checking the match count on a tc filter placed on the receiving
      interface.
      
      But the second host interface (host2_if) has no interest in receiving a
      packet with MAC DA de:ad:be:ef:13:37, so its RX filter drops it even
      before the ingress tc filter gets to be executed. So we will incorrectly
      get the message "Packet was not flooded when should", when in fact, the
      packet was flooded as expected but dropped due to an unrelated reason,
      at some other layer on the receiving side.
      
      Force h2 to accept this packet by temporarily placing it in promiscuous
      mode. Alternatively we could either deliver to its MAC address or use
      tcpdump_start, but this has the fewest complications.
      
      This fixes the "flooding" test from bridge_vlan_aware.sh and
      bridge_vlan_unaware.sh, which calls flood_test from the lib.
      
      Fixes: 236dd50b
      
       ("selftests: forwarding: Add a test for flooded traffic")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b8e629b0
    • Jakub Kicinski's avatar
      Merge tag 'linux-can-fixes-for-5.19-20220704' of... · 7e8c182c
      Jakub Kicinski authored
      Merge tag 'linux-can-fixes-for-5.19-20220704' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
      
      Marc Kleine-Budde says:
      
      ====================
      can 2022-07-04
      
      The 1st patch is by Oliver Hartkopp, targets the BCM CAN protocol and
      converts a costly synchronize_rcu() to call_rcu() to fix a performance
      regression.
      
      Srinivas Neeli's patch for the xilinx_can driver drops the brp limit
      down to 1, as only the pre-production silicon have an issue with a brp
      of 1.
      
      The next patch is by Duy Nguyen and fixes the data transmission on
      R-Car V3U SoCs in the rcar_canfd driver.
      
      Rhett Aultman's patch fixes a DMA memory leak in the gs_usb driver.
      
      Liang He's patch removes an extra of_node_get() in the grcan driver.
      
      The next 2 patches are by me, target the m_can driver and fix the
      timestamp handling used for peripheral devices like the tcan4x5x.
      
      Jimmy Assarsson contributes 3 patches for the kvaser_usb driver and
      fixes CAN clock and bit timing related issues.
      
      The remaining 5 patches target the mcp251xfd driver. Thomas Kopp
      contributes 2 patches to improve the workaround for broken CRC when
      reading the TBC register. 3 patches by me add a missing
      hrtimer_cancel() during the ndo_stop() callback, and fix the reading
      of the Device ID register.
      
      * tag 'linux-can-fixes-for-5.19-20220704' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
        can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix endianness conversion
        can: mcp251xfd: mcp251xfd_register_get_dev_id(): use correct length to read dev_id
        can: mcp251xfd: mcp251xfd_stop(): add missing hrtimer_cancel()
        can: mcp251xfd: mcp251xfd_regmap_crc_read(): update workaround broken CRC on TBC register
        can: mcp251xfd: mcp251xfd_regmap_crc_read(): improve workaround handling for mcp2517fd
        can: kvaser_usb: kvaser_usb_leaf: fix bittiming limits
        can: kvaser_usb: kvaser_usb_leaf: fix CAN clock frequency regression
        can: kvaser_usb: replace run-time checks with struct kvaser_usb_driver_info
        can: m_can: m_can_{read_fifo,echo_tx_event}(): shift timestamp to full 32 bits
        can: m_can: m_can_chip_config(): actually enable internal timestamping
        can: grcan: grcan_probe(): remove extra of_node_get()
        can: gs_usb: gs_usb_open/close(): fix memory leak
        can: rcar_canfd: Fix data transmission failed on R-Car V3U
        Revert "can: xilinx_can: Limit CANFD brp to 2"
        can: bcm: use call_rcu() instead of costly synchronize_rcu()
      ====================
      
      Link: https://lore.kernel.org/r/20220704122613.1551119-1-mkl@pengutronix.de
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      7e8c182c
  3. Jul 04, 2022
  4. Jul 03, 2022
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · 280e3a85
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Insufficient validation of element datatype and length in
         nft_setelem_parse_data(). At least commit 7d740264 updates
         maximum element data area up to 64 bytes when only 16 bytes
         where supported at the time. Support for larger element size
         came later in fdb9c405
      
       though. Picking this older commit
         as Fixes: tag to be safe than sorry.
      
      2) Memleak in pipapo destroy path, reproducible when transaction
         in aborted. This is already triggering in the existing netfilter
         test infrastructure since more recent new tests are covering this
         path.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      280e3a85
    • Pablo Neira Ayuso's avatar
      netfilter: nft_set_pipapo: release elements in clone from abort path · 9827a0e6
      Pablo Neira Ayuso authored
      New elements that reside in the clone are not released in case that the
      transaction is aborted.
      
      [16302.231754] ------------[ cut here ]------------
      [16302.231756] WARNING: CPU: 0 PID: 100509 at net/netfilter/nf_tables_api.c:1864 nf_tables_chain_destroy+0x26/0x127 [nf_tables]
      [...]
      [16302.231882] CPU: 0 PID: 100509 Comm: nft Tainted: G        W         5.19.0-rc3+ #155
      [...]
      [16302.231887] RIP: 0010:nf_tables_chain_destroy+0x26/0x127 [nf_tables]
      [16302.231899] Code: f3 fe ff ff 41 55 41 54 55 53 48 8b 6f 10 48 89 fb 48 c7 c7 82 96 d9 a0 8b 55 50 48 8b 75 58 e8 de f5 92 e0 83 7d 50 00 74 09 <0f> 0b 5b 5d 41 5c 41 5d c3 4c 8b 65 00 48 8b 7d 08 49 39 fc 74 05
      [...]
      [16302.231917] Call Trace:
      [16302.231919]  <TASK>
      [16302.231921]  __nf_tables_abort.cold+0x23/0x28 [nf_tables]
      [16302.231934]  nf_tables_abort+0x30/0x50 [nf_tables]
      [16302.231946]  nfnetlink_rcv_batch+0x41a/0x840 [nfnetlink]
      [16302.231952]  ? __nla_validate_parse+0x48/0x190
      [16302.231959]  nfnetlink_rcv+0x110/0x129 [nfnetlink]
      [16302.231963]  netlink_unicast+0x211/0x340
      [16302.231969]  netlink_sendmsg+0x21e/0x460
      
      Add nft_set_pipapo_match_destroy() helper function to release the
      elements in the lookup tables.
      
      Stefano Brivio says: "We additionally look for elements pointers in the
      cloned matching data if priv->dirty is set, because that means that
      cloned data might point to additional elements we did not commit to the
      working copy yet (such as the abort path case, but perhaps not limited
      to it)."
      
      Fixes: 3c4287f6
      
       ("nf_tables: Add set type for arbitrary concatenation of ranges")
      Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      9827a0e6
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: stricter validation of element data · 7e6bc1f6
      Pablo Neira Ayuso authored
      Make sure element data type and length do not mismatch the one specified
      by the set declaration.
      
      Fixes: 7d740264
      
       ("netfilter: nf_tables: variable sized set element keys / data")
      Reported-by: default avatarHugues ANGUELKOV <hanguelkov@randorisec.fr>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      7e6bc1f6
  5. Jul 02, 2022