Skip to content
  1. Jul 05, 2022
    • 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
  2. Jul 04, 2022
  3. 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
  4. Jul 02, 2022
    • Karsten Graul's avatar
      MAINTAINERS: add Wenjia as SMC maintainer · 3d5a2a39
      Karsten Graul authored
      
      
      Add Wenjia as maintainer for Shared Memory Communications (SMC)
      Sockets.
      
      Acked-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
      Acked-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
      Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d5a2a39
    • Hangbin Liu's avatar
      selftests/net: fix section name when using xdp_dummy.o · d28b25a6
      Hangbin Liu authored
      Since commit 8fffa0e3 ("selftests/bpf: Normalize XDP section names in
      selftests") the xdp_dummy.o's section name has changed to xdp. But some
      tests are still using "section xdp_dummy", which make the tests failed.
      Fix them by updating to the new section name.
      
      Fixes: 8fffa0e3
      
       ("selftests/bpf: Normalize XDP section names in selftests")
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/r/20220630062228.3453016-1-liuhangbin@gmail.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d28b25a6
    • Jakub Kicinski's avatar
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · bc38fae3
      Jakub Kicinski authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2022-07-02
      
      We've added 7 non-merge commits during the last 14 day(s) which contain
      a total of 6 files changed, 193 insertions(+), 86 deletions(-).
      
      The main changes are:
      
      1) Fix clearing of page contiguity when unmapping XSK pool, from Ivan Malov.
      
      2) Two verifier fixes around bounds data propagation, from Daniel Borkmann.
      
      3) Fix fprobe sample module's parameter descriptions, from Masami Hiramatsu.
      
      4) General BPF maintainer entry revamp to better scale patch reviews.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        bpf, selftests: Add verifier test case for jmp32's jeq/jne
        bpf, selftests: Add verifier test case for imm=0,umin=0,umax=1 scalar
        bpf: Fix insufficient bounds propagation from adjust_scalar_min_max_vals
        bpf: Fix incorrect verifier simulation around jmp32's jeq/jne
        xsk: Clear page contiguity bit when unmapping pool
        bpf, docs: Better scale maintenance of BPF subsystem
        fprobe, samples: Add module parameter descriptions
      ====================
      
      Link: https://lore.kernel.org/r/20220701230121.10354-1-daniel@iogearbox.net
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bc38fae3
    • Daniel Borkmann's avatar
      bpf, selftests: Add verifier test case for jmp32's jeq/jne · a49b8ce7
      Daniel Borkmann authored
      
      
      Add a test case to trigger the verifier's incorrect conclusion in the
      case of jmp32's jeq/jne. Also here, make use of dead code elimination,
      so that we can see the verifier bailing out on unfixed kernels.
      
      Before:
      
        # ./test_verifier 724
        #724/p jeq32/jne32: bounds checking FAIL
        Failed to load prog 'Permission denied'!
        R4 !read_ok
        verification time 8 usec
        stack depth 0
        processed 8 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 0
        Summary: 0 PASSED, 0 SKIPPED, 1 FAILED
      
      After:
      
        # ./test_verifier 724
        #724/p jeq32/jne32: bounds checking OK
        Summary: 1 PASSED, 0 SKIPPED, 0 FAILED
      
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20220701124727.11153-4-daniel@iogearbox.net
      a49b8ce7
    • Daniel Borkmann's avatar
      bpf, selftests: Add verifier test case for imm=0,umin=0,umax=1 scalar · 73c4936f
      Daniel Borkmann authored
      
      
      Add a test case to trigger the constant scalar issue which leaves the
      register in scalar(imm=0,umin=0,umax=1,var_off=(0x0; 0x0)) state. Make
      use of dead code elimination, so that we can see the verifier bailing
      out on unfixed kernels. For the condition, we use jle given it checks
      on umax bound.
      
      Before:
      
        # ./test_verifier 743
        #743/p jump & dead code elimination FAIL
        Failed to load prog 'Permission denied'!
        R4 !read_ok
        verification time 11 usec
        stack depth 0
        processed 13 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 1
        Summary: 0 PASSED, 0 SKIPPED, 1 FAILED
      
      After:
      
        # ./test_verifier 743
        #743/p jump & dead code elimination OK
        Summary: 1 PASSED, 0 SKIPPED, 0 FAILED
      
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20220701124727.11153-3-daniel@iogearbox.net
      73c4936f
    • Daniel Borkmann's avatar
      bpf: Fix insufficient bounds propagation from adjust_scalar_min_max_vals · 3844d153
      Daniel Borkmann authored
      Kuee reported a corner case where the tnum becomes constant after the call
      to __reg_bound_offset(), but the register's bounds are not, that is, its
      min bounds are still not equal to the register's max bounds.
      
      This in turn allows to leak pointers through turning a pointer register as
      is into an unknown scalar via adjust_ptr_min_max_vals().
      
      Before:
      
        func#0 @0
        0: R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0))
        0: (b7) r0 = 1                        ; R0_w=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0))
        1: (b7) r3 = 0                        ; R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0))
        2: (87) r3 = -r3                      ; R3_w=scalar()
        3: (87) r3 = -r3                      ; R3_w=scalar()
        4: (47) r3 |= 32767                   ; R3_w=scalar(smin=-9223372036854743041,umin=32767,var_off=(0x7fff; 0xffffffffffff8000),s32_min=-2147450881)
        5: (75) if r3 s>= 0x0 goto pc+1       ; R3_w=scalar(umin=9223372036854808575,var_off=(0x8000000000007fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767)
        6: (95) exit
      
        from 5 to 7: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0))
        7: (d5) if r3 s<= 0x8000 goto pc+1    ; R3=scalar(umin=32769,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767)
        8: (95) exit
      
        from 7 to 9: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=32768,var_off=(0x7fff; 0x8000)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0))
        9: (07) r3 += -32767                  ; R3_w=scalar(imm=0,umax=1,var_off=(0x0; 0x0))  <--- [*]
        10: (95) exit
      
      What can be seen here is that R3=scalar(umin=32767,umax=32768,var_off=(0x7fff;
      0x8000)) after the operation R3 += -32767 results in a 'malformed' constant, that
      is, R3_w=scalar(imm=0,umax=1,var_off=(0x0; 0x0)). Intersecting with var_off has
      not been done at that point via __update_reg_bounds(), which would have improved
      the umax to be equal to umin.
      
      Refactor the tnum <> min/max bounds information flow into a reg_bounds_sync()
      helper and use it consistently everywhere. After the fix, bounds have been
      corrected to R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0)) and thus the register
      is regarded as a 'proper' constant scalar of 0.
      
      After:
      
        func#0 @0
        0: R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0))
        0: (b7) r0 = 1                        ; R0_w=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0))
        1: (b7) r3 = 0                        ; R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0))
        2: (87) r3 = -r3                      ; R3_w=scalar()
        3: (87) r3 = -r3                      ; R3_w=scalar()
        4: (47) r3 |= 32767                   ; R3_w=scalar(smin=-9223372036854743041,umin=32767,var_off=(0x7fff; 0xffffffffffff8000),s32_min=-2147450881)
        5: (75) if r3 s>= 0x0 goto pc+1       ; R3_w=scalar(umin=9223372036854808575,var_off=(0x8000000000007fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767)
        6: (95) exit
      
        from 5 to 7: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0))
        7: (d5) if r3 s<= 0x8000 goto pc+1    ; R3=scalar(umin=32769,umax=9223372036854775807,var_off=(0x7fff; 0x7fffffffffff8000),s32_min=-2147450881,u32_min=32767)
        8: (95) exit
      
        from 7 to 9: R0=scalar(imm=1,umin=1,umax=1,var_off=(0x1; 0x0)) R1=ctx(off=0,imm=0,umax=0,var_off=(0x0; 0x0)) R3=scalar(umin=32767,umax=32768,var_off=(0x7fff; 0x8000)) R10=fp(off=0,imm=0,umax=0,var_off=(0x0; 0x0))
        9: (07) r3 += -32767                  ; R3_w=scalar(imm=0,umax=0,var_off=(0x0; 0x0))  <--- [*]
        10: (95) exit
      
      Fixes: b03c9f9f
      
       ("bpf/verifier: track signed and unsigned min/max values")
      Reported-by: default avatarKuee K1r0a <liulin063@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20220701124727.11153-2-daniel@iogearbox.net
      3844d153
    • Daniel Borkmann's avatar
      bpf: Fix incorrect verifier simulation around jmp32's jeq/jne · a12ca627
      Daniel Borkmann authored
      Kuee reported a quirk in the jmp32's jeq/jne simulation, namely that the
      register value does not match expectations for the fall-through path. For
      example:
      
      Before fix:
      
        0: R1=ctx(off=0,imm=0) R10=fp0
        0: (b7) r2 = 0                        ; R2_w=P0
        1: (b7) r6 = 563                      ; R6_w=P563
        2: (87) r2 = -r2                      ; R2_w=Pscalar()
        3: (87) r2 = -r2                      ; R2_w=Pscalar()
        4: (4c) w2 |= w6                      ; R2_w=Pscalar(umin=563,umax=4294967295,var_off=(0x233; 0xfffffdcc),s32_min=-2147483085) R6_w=P563
        5: (56) if w2 != 0x8 goto pc+1        ; R2_w=P571  <--- [*]
        6: (95) exit
        R0 !read_ok
      
      After fix:
      
        0: R1=ctx(off=0,imm=0) R10=fp0
        0: (b7) r2 = 0                        ; R2_w=P0
        1: (b7) r6 = 563                      ; R6_w=P563
        2: (87) r2 = -r2                      ; R2_w=Pscalar()
        3: (87) r2 = -r2                      ; R2_w=Pscalar()
        4: (4c) w2 |= w6                      ; R2_w=Pscalar(umin=563,umax=4294967295,var_off=(0x233; 0xfffffdcc),s32_min=-2147483085) R6_w=P563
        5: (56) if w2 != 0x8 goto pc+1        ; R2_w=P8  <--- [*]
        6: (95) exit
        R0 !read_ok
      
      As can be seen on line 5 for the branch fall-through path in R2 [*] is that
      given condition w2 != 0x8 is false, verifier should conclude that r2 = 8 as
      upper 32 bit are known to be zero. However, verifier incorrectly concludes
      that r2 = 571 which is far off.
      
      The problem is it only marks false{true}_reg as known in the switch for JE/NE
      case, but at the end of the function, it uses {false,true}_{64,32}off to
      update {false,true}_reg->var_off and they still hold the prior value of
      {false,true}_reg->var_off before it got marked as known. The subsequent
      __reg_combine_32_into_64() then propagates this old var_off and derives new
      bounds. The information between min/max bounds on {false,true}_reg from
      setting the register to known const combined with the {false,true}_reg->var_off
      based on the old information then derives wrong register data.
      
      Fix it by detangling the BPF_JEQ/BPF_JNE cases and updating relevant
      {false,true}_{64,32}off tnums along with the register marking to known
      constant.
      
      Fixes: 3f50f132
      
       ("bpf: Verifier, do explicit ALU32 bounds tracking")
      Reported-by: default avatarKuee K1r0a <liulin063@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Acked-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Link: https://lore.kernel.org/bpf/20220701124727.11153-1-daniel@iogearbox.net
      a12ca627
  5. Jul 01, 2022
    • Li kunyu's avatar
      net: usb: Fix typo in code · 8dfeee9d
      Li kunyu authored
      
      
      Remove the repeated ';' from code.
      
      Signed-off-by: default avatarLi kunyu <kunyu@nfschina.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8dfeee9d
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 71560d98
      David S. Miller authored
      
      
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2022-06-30
      
      This series contains updates to i40e driver only.
      
      Lukasz adds reporting of packets dropped for being too large into the Rx
      dropped statistics.
      
      Norbert clears VF filter and MAC address to resolve issue with older VFs
      being unable to change their MAC address.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      71560d98
    • Linus Torvalds's avatar
      Merge tag 'net-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 5e837935
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from netfilter.
      
        Current release - new code bugs:
      
         - clear msg_get_inq in __sys_recvfrom() and __copy_msghdr_from_user()
      
         - mptcp:
            - invoke MP_FAIL response only when needed
            - fix shutdown vs fallback race
            - consistent map handling on failure
      
         - octeon_ep: use bitwise AND
      
        Previous releases - regressions:
      
         - tipc: move bc link creation back to tipc_node_create, fix NPD
      
        Previous releases - always broken:
      
         - tcp: add a missing nf_reset_ct() in 3WHS handling to prevent socket
           buffered skbs from keeping refcount on the conntrack module
      
         - ipv6: take care of disable_policy when restoring routes
      
         - tun: make sure to always disable and unlink NAPI instances
      
         - phy: don't trigger state machine while in suspend
      
         - netfilter: nf_tables: avoid skb access on nf_stolen
      
         - asix: fix "can't send until first packet is send" issue
      
         - usb: asix: do not force pause frames support
      
         - nxp-nci: don't issue a zero length i2c_master_read()
      
        Misc:
      
         - ncsi: allow use of proper "mellanox" DT vendor prefix
      
         - act_api: add a message for user space if any actions were already
           flushed before the error was hit"
      
      * tag 'net-5.19-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (55 commits)
        net: dsa: felix: fix race between reading PSFP stats and port stats
        selftest: tun: add test for NAPI dismantle
        net: tun: avoid disabling NAPI twice
        net: sparx5: mdb add/del handle non-sparx5 devices
        net: sfp: fix memory leak in sfp_probe()
        mlxsw: spectrum_router: Fix rollback in tunnel next hop init
        net: rose: fix UAF bugs caused by timer handler
        net: usb: ax88179_178a: Fix packet receiving
        net: bonding: fix use-after-free after 802.3ad slave unbind
        ipv6: fix lockdep splat in in6_dump_addrs()
        net: phy: ax88772a: fix lost pause advertisement configuration
        net: phy: Don't trigger state machine while in suspend
        usbnet: fix memory allocation in helpers
        selftests net: fix kselftest net fatal error
        NFC: nxp-nci: don't print header length mismatch on i2c error
        NFC: nxp-nci: Don't issue a zero length i2c_master_read()
        net: tipc: fix possible refcount leak in tipc_sk_create()
        nfc: nfcmrvl: Fix irq_of_parse_and_map() return value
        net: ipv6: unexport __init-annotated seg6_hmac_net_init()
        ipv6/sit: fix ipip6_tunnel_get_prl return value
        ...
      5e837935
    • Amir Goldstein's avatar
      vfs: fix copy_file_range() regression in cross-fs copies · 868f9f2f
      Amir Goldstein authored
      A regression has been reported by Nicolas Boichat, found while using the
      copy_file_range syscall to copy a tracefs file.
      
      Before commit 5dae222a ("vfs: allow copy_file_range to copy across
      devices") the kernel would return -EXDEV to userspace when trying to
      copy a file across different filesystems.  After this commit, the
      syscall doesn't fail anymore and instead returns zero (zero bytes
      copied), as this file's content is generated on-the-fly and thus reports
      a size of zero.
      
      Another regression has been reported by He Zhe - the assertion of
      WARN_ON_ONCE(ret == -EOPNOTSUPP) can be triggered from userspace when
      copying from a sysfs file whose read operation may return -EOPNOTSUPP.
      
      Since we do not have test coverage for copy_file_range() between any two
      types of filesystems, the best way to avoid these sort of issues in the
      future is for the kernel to be more picky about filesystems that are
      allowed to do copy_file_range().
      
      This patch restores some cross-filesystem copy restrictions that existed
      prior to commit 5dae222a ("vfs: allow copy_file_range to copy across
      devices"), namely, cross-sb copy is not allowed for filesystems that do
      not implement ->copy_file_range().
      
      Filesystems that do implement ->copy_file_range() have full control of
      the result - if this method returns an error, the error is returned to
      the user.  Before this change this was only true for fs that did not
      implement the ->remap_file_range() operation (i.e.  nfsv3).
      
      Filesystems that do not implement ->copy_file_range() still fall-back to
      the generic_copy_file_range() implementation when the copy is within the
      same sb.  This helps the kernel can maintain a more consistent story
      about which filesystems support copy_file_range().
      
      nfsd and ksmbd servers are modified to fall-back to the
      generic_copy_file_range() implementation in case vfs_copy_file_range()
      fails with -EOPNOTSUPP or -EXDEV, which preserves behavior of
      server-side-copy.
      
      fall-back to generic_copy_file_range() is not implemented for the smb
      operation FSCTL_DUPLICATE_EXTENTS_TO_FILE, which is arguably a correct
      change of behavior.
      
      Fixes: 5dae222a
      
       ("vfs: allow copy_file_range to copy across devices")
      Link: https://lore.kernel.org/linux-fsdevel/20210212044405.4120619-1-drinkcat@chromium.org/
      Link: https://lore.kernel.org/linux-fsdevel/CANMq1KDZuxir2LM5jOTm0xx+BnvW=ZmpsG47CyHFJwnw7zSX6Q@mail.gmail.com/
      Link: https://lore.kernel.org/linux-fsdevel/20210126135012.1.If45b7cdc3ff707bc1efa17f5366057d60603c45f@changeid/
      Link: https://lore.kernel.org/linux-fsdevel/20210630161320.29006-1-lhenriques@suse.de/
      Reported-by: default avatarNicolas Boichat <drinkcat@chromium.org>
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Signed-off-by: default avatarLuis Henriques <lhenriques@suse.de>
      Fixes: 64bf5ff5
      
       ("vfs: no fallback for ->copy_file_range")
      Link: https://lore.kernel.org/linux-fsdevel/20f17f64-88cb-4e80-07c1-85cb96c83619@windriver.com/
      Reported-by: default avatarHe Zhe <zhe.he@windriver.com>
      Tested-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Tested-by: default avatarLuis Henriques <lhenriques@suse.de>
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      868f9f2f
    • Norbert Zulinski's avatar
      i40e: Fix VF's MAC Address change on VM · fed0d9f1
      Norbert Zulinski authored
      Clear VF MAC from parent PF and remove VF filter from VSI when both
      conditions are true:
      -VIRTCHNL_VF_OFFLOAD_USO is not used
      -VM MAC was not set from PF level
      
      It affects older version of IAVF and it allow them to change MAC
      Address on VM, newer IAVF won't change their behaviour.
      
      Previously it wasn't possible to change VF's MAC Address on VM
      because there is flag on IAVF driver that won't allow to
      change MAC Address if this address is given from PF driver.
      
      Fixes: 155f0ac2
      
       ("iavf: allow permanent MAC address to change")
      Signed-off-by: default avatarNorbert Zulinski <norbertx.zulinski@intel.com>
      Signed-off-by: default avatarJan Sokolowski <jan.sokolowski@intel.com>
      Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      fed0d9f1
    • Lukasz Cieplicki's avatar
      i40e: Fix dropped jumbo frames statistics · 1adb1563
      Lukasz Cieplicki authored
      Dropped packets caused by too large frames were not included in
      dropped RX packets statistics.
      Issue was caused by not reading the GL_RXERR1 register. That register
      stores count of packet which was have been dropped due to too large
      size.
      
      Fix it by reading GL_RXERR1 register for each interface.
      
      Repro steps:
      Send a packet larger than the set MTU to SUT
      Observe rx statists: ethtool -S <interface> | grep rx | grep -v ": 0"
      
      Fixes: 41a9e55c
      
       ("i40e: add missing VSI statistics")
      Signed-off-by: default avatarLukasz Cieplicki <lukaszx.cieplicki@intel.com>
      Signed-off-by: default avatarJedrzej Jagielski <jedrzej.jagielski@intel.com>
      Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1adb1563
    • Vladimir Oltean's avatar
      net: dsa: felix: fix race between reading PSFP stats and port stats · 58bf4db6
      Vladimir Oltean authored
      Both PSFP stats and the port stats read by ocelot_check_stats_work() are
      indirectly read through the same mechanism - write to STAT_CFG:STAT_VIEW,
      read from SYS:STAT:CNT[n].
      
      It's just that for port stats, we write STAT_VIEW with the index of the
      port, and for PSFP stats, we write STAT_VIEW with the filter index.
      
      So if we allow them to run concurrently, ocelot_check_stats_work() may
      change the view from vsc9959_psfp_counters_get(), and vice versa.
      
      Fixes: 7d4b564d
      
       ("net: dsa: felix: support psfp filter on vsc9959")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20220629183007.3808130-1-vladimir.oltean@nxp.com
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      58bf4db6
    • Jakub Kicinski's avatar
      selftest: tun: add test for NAPI dismantle · 839b92fe
      Jakub Kicinski authored
      
      
      Being lazy does not pay, add the test for various
      ordering of tun queue close / detach / destroy.
      
      Link: https://lore.kernel.org/r/20220629181911.372047-2-kuba@kernel.org
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      839b92fe