1. 09 Dec, 2021 23 commits
  2. 08 Dec, 2021 17 commits
    • Russell King (Oracle)'s avatar
      net: dsa: mv88e6xxx: fix "don't use PHY_DETECT on internal PHY's" · 2b29cb9e
      Russell King (Oracle) authored
      This commit fixes a misunderstanding in commit 4a3e0aed ("net: dsa:
      mv88e6xxx: don't use PHY_DETECT on internal PHY's").
      
      For Marvell DSA switches with the PHY_DETECT bit (for non-6250 family
      devices), controls whether the PPU polls the PHY to retrieve the link,
      speed, duplex and pause status to update the port configuration. This
      applies for both internal and external PHYs.
      
      For some switches such as 88E6352 and 88E6390X, PHY_DETECT has an
      additional function of enabling auto-media mode between the internal
      PHY and SERDES blocks depending on which first gains link.
      
      The original intention of commit 5d5b231d (net: dsa: mv88e6xxx: use
      PHY_DETECT in mac_link_up/mac_link_down) was to allow this bit to be
      used to detect when this propagation is enabled, and allow software to
      update the port configuration. This has found to be necessary for some
      switches which do not automatically propagate status from the SERDES to
      the port, which includes the 88E6390. However, commit 4a3e0aed
      ("net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's") breaks
      this assumption.
      
      Maarten Zanders has confirmed that the issue he was addressing was for
      an 88E6250 switch, which does not have a PHY_DETECT bit in bit 12, but
      instead a link status bit. Therefore, mv88e6xxx_port_ppu_updates() does
      not report correctly.
      
      This patch resolves the above issues by reverting Maarten's change and
      instead making mv88e6xxx_port_ppu_updates() indicate whether the port
      is internal for the 88E6250 family of switches.
      
        Yes, you're right, I'm targeting the 6250 family. And yes, your
        suggestion would solve my case and is a better implementation for
        the other devices (as far as I can see).
      
      Fixes: 4a3e0aed ("net: dsa: mv88e6xxx: don't use PHY_DETECT on internal PHY's")
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Tested-by: default avatarMaarten Zanders <maarten.zanders@mind.be>
      Link: https://lore.kernel.org/r/E1muXm7-00EwJB-7n@rmk-PC.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2b29cb9e
    • Jesse Brandeburg's avatar
      ice: safer stats processing · 1a0f25a5
      Jesse Brandeburg authored
      The driver was zeroing live stats that could be fetched by
      ndo_get_stats64 at any time. This could result in inconsistent
      statistics, and the telltale sign was when reading stats frequently from
      /proc/net/dev, the stats would go backwards.
      
      Fix by collecting stats into a local, and delaying when we write to the
      structure so it's not incremental.
      
      Fixes: fcea6f3d ("ice: Add stats and ethtool support")
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: default avatarGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      1a0f25a5
    • Maxim Mikityanskiy's avatar
      bpf: Add selftests to cover packet access corner cases · b560b21f
      Maxim Mikityanskiy authored
      This commit adds BPF verifier selftests that cover all corner cases by
      packet boundary checks. Specifically, 8-byte packet reads are tested at
      the beginning of data and at the beginning of data_meta, using all kinds
      of boundary checks (all comparison operators: <, >, <=, >=; both
      permutations of operands: data + length compared to end, end compared to
      data + length). For each case there are three tests:
      
      1. Length is just enough for an 8-byte read. Length is either 7 or 8,
         depending on the comparison.
      
      2. Length is increased by 1 - should still pass the verifier. These
         cases are useful, because they failed before commit 2fa7d94a
         ("bpf: Fix the off-by-two error in range markings").
      
      3. Length is decreased by 1 - should be rejected by the verifier.
      
      Some existing tests are just renamed to avoid duplication.
      Signed-off-by: default avatarMaxim Mikityanskiy <maximmi@nvidia.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20211207081521.41923-1-maximmi@nvidia.com
      b560b21f
    • Joakim Zhang's avatar
      net: fec: only clear interrupt of handling queue in fec_enet_rx_queue() · b5bd95d1
      Joakim Zhang authored
      Background:
      We have a customer is running a Profinet stack on the 8MM which receives and
      responds PNIO packets every 4ms and PNIO-CM packets every 40ms. However, from
      time to time the received PNIO-CM package is "stock" and is only handled when
      receiving a new PNIO-CM or DCERPC-Ping packet (tcpdump shows the PNIO-CM and
      the DCERPC-Ping packet at the same time but the PNIO-CM HW timestamp is from
      the expected 40 ms and not the 2s delay of the DCERPC-Ping).
      
      After debugging, we noticed PNIO, PNIO-CM and DCERPC-Ping packets would
      be handled by different RX queues.
      
      The root cause should be driver ack all queues' interrupt when handle a
      specific queue in fec_enet_rx_queue(). The blamed patch is introduced to
      receive as much packets as possible once to avoid interrupt flooding.
      But it's unreasonable to clear other queues'interrupt when handling one
      queue, this patch tries to fix it.
      
      Fixes: ed63f1dc (net: fec: clear receive interrupts before processing a packet)
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Reported-by: default avatarNicolas Diaz <nicolas.diaz@nxp.com>
      Signed-off-by: default avatarJoakim Zhang <qiangqing.zhang@nxp.com>
      Link: https://lore.kernel.org/r/20211206135457.15946-1-qiangqing.zhang@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b5bd95d1
    • Jakub Kicinski's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue · 65af674a
      Jakub Kicinski authored
      Tony Nguyen says:
      
      ====================
      Intel Wired LAN Driver Updates 2021-12-06
      
      This series contains updates to iavf and i40e drivers.
      
      Mitch adds restoration of MSI state during reset for iavf.
      
      Michal fixes checking and reporting of descriptor count changes to
      communicate changes and/or issues for iavf.
      
      Karen resolves an issue with failed handling of VF requests while a VF
      reset is occurring for i40e.
      
      Mateusz removes clearing of VF requested queue count when configuring
      VF ADQ for i40e.
      
      Norbert fixes a NULL pointer dereference that can occur when getting VSI
      descriptors for i40e.
      ====================
      
      Link: https://lore.kernel.org/r/20211206183519.2733180-1-anthony.l.nguyen@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      65af674a
    • Jakub Kicinski's avatar
      Merge branch 'net-phy-fix-doc-build-warning' · 9e892688
      Jakub Kicinski authored
      Yanteng Si says:
      
      ====================
      net: phy: Fix doc build warnings
      ====================
      
      Link: https://lore.kernel.org/r/cover.1638776933.git.siyanteng@loongson.cnSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9e892688
    • Yanteng Si's avatar
      net: phy: Add the missing blank line in the phylink_suspend comment · c35e8de7
      Yanteng Si authored
      Fix warning as:
      
      Documentation/networking/kapi:147: ./drivers/net/phy/phylink.c:1657: WARNING: Unexpected indentation.
      Documentation/networking/kapi:147: ./drivers/net/phy/phylink.c:1658: WARNING: Block quote ends without a blank line; unexpected unindent.
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c35e8de7
    • Yanteng Si's avatar
      net: phy: Remove unnecessary indentation in the comments of phy_device · a97770cc
      Yanteng Si authored
      Fix warning as:
      
      linux-next/Documentation/networking/kapi:122: ./include/linux/phy.h:543: WARNING: Unexpected indentation.
      linux-next/Documentation/networking/kapi:122: ./include/linux/phy.h:544: WARNING: Block quote ends without a blank line; unexpected unindent.
      linux-next/Documentation/networking/kapi:122: ./include/linux/phy.h:546: WARNING: Unexpected indentation.
      Suggested-by: default avatarAkira Yokosawa <akiyks@gmail.com>
      Signed-off-by: default avatarYanteng Si <siyanteng@loongson.cn>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a97770cc
    • Ameer Hamza's avatar
      gve: fix for null pointer dereference. · e6f60c51
      Ameer Hamza authored
      Avoid passing NULL skb to __skb_put() function call if
      napi_alloc_skb() returns NULL.
      
      Fixes: 37149e93 ("gve: Implement packet continuation for RX.")
      Signed-off-by: default avatarAmeer Hamza <amhamza.mgc@gmail.com>
      Link: https://lore.kernel.org/r/20211205183810.8299-1-amhamza.mgc@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e6f60c51
    • Petr Machata's avatar
      MAINTAINERS: net: mlxsw: Remove Jiri as a maintainer, add myself · 6ebe4b35
      Petr Machata authored
      Jiri has moved on and will not carry out the mlxsw maintainership duty any
      longer. Add myself as a co-maintainer instead.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Acked-by: default avatarJiri Pirko <jiri@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Link: https://lore.kernel.org/r/45b54312cdebaf65c5d110b15a5dd2df795bf2be.1638807297.git.petrm@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6ebe4b35
    • Jakub Kicinski's avatar
      Merge branch 'net-tls-cover-all-ciphers-with-tests' · 56a271be
      Jakub Kicinski authored
      Vadim Fedorenko says:
      
      ====================
      net: tls: cover all ciphers with tests
      
      Recent patches to Kernel TLS showed that some ciphers are not covered
      with tests. Let's cover missed.
      ====================
      
      Link: https://lore.kernel.org/r/20211206213932.7508-1-vfedorenko@novek.ruSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      56a271be
    • Vadim Fedorenko's avatar
      selftests: tls: add missing AES256-GCM cipher · 13bf99ab
      Vadim Fedorenko authored
      Add tests for TLSv1.2 and TLSv1.3 with AES256-GCM cipher
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      13bf99ab
    • Vadim Fedorenko's avatar
      selftests: tls: add missing AES-CCM cipher tests · d76c51f9
      Vadim Fedorenko authored
      Add tests for TLSv1.2 and TLSv1.3 with AES-CCM cipher.
      Signed-off-by: default avatarVadim Fedorenko <vfedorenko@novek.ru>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d76c51f9
    • Eric Dumazet's avatar
      netfilter: conntrack: annotate data-races around ct->timeout · 802a7dc5
      Eric Dumazet authored
      (struct nf_conn)->timeout can be read/written locklessly,
      add READ_ONCE()/WRITE_ONCE() to prevent load/store tearing.
      
      BUG: KCSAN: data-race in __nf_conntrack_alloc / __nf_conntrack_find_get
      
      write to 0xffff888132e78c08 of 4 bytes by task 6029 on cpu 0:
       __nf_conntrack_alloc+0x158/0x280 net/netfilter/nf_conntrack_core.c:1563
       init_conntrack+0x1da/0xb30 net/netfilter/nf_conntrack_core.c:1635
       resolve_normal_ct+0x502/0x610 net/netfilter/nf_conntrack_core.c:1746
       nf_conntrack_in+0x1c5/0x88f net/netfilter/nf_conntrack_core.c:1901
       ipv6_conntrack_local+0x19/0x20 net/netfilter/nf_conntrack_proto.c:414
       nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
       nf_hook_slow+0x72/0x170 net/netfilter/core.c:619
       nf_hook include/linux/netfilter.h:262 [inline]
       NF_HOOK include/linux/netfilter.h:305 [inline]
       ip6_xmit+0xa3a/0xa60 net/ipv6/ip6_output.c:324
       inet6_csk_xmit+0x1a2/0x1e0 net/ipv6/inet6_connection_sock.c:135
       __tcp_transmit_skb+0x132a/0x1840 net/ipv4/tcp_output.c:1402
       tcp_transmit_skb net/ipv4/tcp_output.c:1420 [inline]
       tcp_write_xmit+0x1450/0x4460 net/ipv4/tcp_output.c:2680
       __tcp_push_pending_frames+0x68/0x1c0 net/ipv4/tcp_output.c:2864
       tcp_push_pending_frames include/net/tcp.h:1897 [inline]
       tcp_data_snd_check+0x62/0x2e0 net/ipv4/tcp_input.c:5452
       tcp_rcv_established+0x880/0x10e0 net/ipv4/tcp_input.c:5947
       tcp_v6_do_rcv+0x36e/0xa50 net/ipv6/tcp_ipv6.c:1521
       sk_backlog_rcv include/net/sock.h:1030 [inline]
       __release_sock+0xf2/0x270 net/core/sock.c:2768
       release_sock+0x40/0x110 net/core/sock.c:3300
       sk_stream_wait_memory+0x435/0x700 net/core/stream.c:145
       tcp_sendmsg_locked+0xb85/0x25a0 net/ipv4/tcp.c:1402
       tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1440
       inet6_sendmsg+0x5f/0x80 net/ipv6/af_inet6.c:644
       sock_sendmsg_nosec net/socket.c:704 [inline]
       sock_sendmsg net/socket.c:724 [inline]
       __sys_sendto+0x21e/0x2c0 net/socket.c:2036
       __do_sys_sendto net/socket.c:2048 [inline]
       __se_sys_sendto net/socket.c:2044 [inline]
       __x64_sys_sendto+0x74/0x90 net/socket.c:2044
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      read to 0xffff888132e78c08 of 4 bytes by task 17446 on cpu 1:
       nf_ct_is_expired include/net/netfilter/nf_conntrack.h:286 [inline]
       ____nf_conntrack_find net/netfilter/nf_conntrack_core.c:776 [inline]
       __nf_conntrack_find_get+0x1c7/0xac0 net/netfilter/nf_conntrack_core.c:807
       resolve_normal_ct+0x273/0x610 net/netfilter/nf_conntrack_core.c:1734
       nf_conntrack_in+0x1c5/0x88f net/netfilter/nf_conntrack_core.c:1901
       ipv6_conntrack_local+0x19/0x20 net/netfilter/nf_conntrack_proto.c:414
       nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
       nf_hook_slow+0x72/0x170 net/netfilter/core.c:619
       nf_hook include/linux/netfilter.h:262 [inline]
       NF_HOOK include/linux/netfilter.h:305 [inline]
       ip6_xmit+0xa3a/0xa60 net/ipv6/ip6_output.c:324
       inet6_csk_xmit+0x1a2/0x1e0 net/ipv6/inet6_connection_sock.c:135
       __tcp_transmit_skb+0x132a/0x1840 net/ipv4/tcp_output.c:1402
       __tcp_send_ack+0x1fd/0x300 net/ipv4/tcp_output.c:3956
       tcp_send_ack+0x23/0x30 net/ipv4/tcp_output.c:3962
       __tcp_ack_snd_check+0x2d8/0x510 net/ipv4/tcp_input.c:5478
       tcp_ack_snd_check net/ipv4/tcp_input.c:5523 [inline]
       tcp_rcv_established+0x8c2/0x10e0 net/ipv4/tcp_input.c:5948
       tcp_v6_do_rcv+0x36e/0xa50 net/ipv6/tcp_ipv6.c:1521
       sk_backlog_rcv include/net/sock.h:1030 [inline]
       __release_sock+0xf2/0x270 net/core/sock.c:2768
       release_sock+0x40/0x110 net/core/sock.c:3300
       tcp_sendpage+0x94/0xb0 net/ipv4/tcp.c:1114
       inet_sendpage+0x7f/0xc0 net/ipv4/af_inet.c:833
       rds_tcp_xmit+0x376/0x5f0 net/rds/tcp_send.c:118
       rds_send_xmit+0xbed/0x1500 net/rds/send.c:367
       rds_send_worker+0x43/0x200 net/rds/threads.c:200
       process_one_work+0x3fc/0x980 kernel/workqueue.c:2298
       worker_thread+0x616/0xa70 kernel/workqueue.c:2445
       kthread+0x2c7/0x2e0 kernel/kthread.c:327
       ret_from_fork+0x1f/0x30
      
      value changed: 0x00027cc2 -> 0x00000000
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 1 PID: 17446 Comm: kworker/u4:5 Tainted: G        W         5.16.0-rc4-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Workqueue: krdsd rds_send_worker
      
      Note: I chose an arbitrary commit for the Fixes: tag,
      because I do not think we need to backport this fix to very old kernels.
      
      Fixes: e37542ba ("netfilter: conntrack: avoid possible false sharing")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      802a7dc5
    • Florian Westphal's avatar
      selftests: netfilter: switch zone stress to socat · d46cea0e
      Florian Westphal authored
      centos9 has nmap-ncat which doesn't like the '-q' option, use socat.
      While at it, mark test skipped if needed tools are missing.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      d46cea0e
    • Pablo Neira Ayuso's avatar
      netfilter: nft_exthdr: break evaluation if setting TCP option fails · 962e5a40
      Pablo Neira Ayuso authored
      Break rule evaluation on malformed TCP options.
      
      Fixes: 99d1712b ("netfilter: exthdr: tcp option set support")
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      962e5a40
    • Stefano Brivio's avatar
      selftests: netfilter: Add correctness test for mac,net set type · 0de53b0f
      Stefano Brivio authored
      The existing net,mac test didn't cover the issue recently reported
      by Nikita Yushchenko, where MAC addresses wouldn't match if given
      as first field of a concatenated set with AVX2 and 8-bit groups,
      because there's a different code path covering the lookup of six
      8-bit groups (MAC addresses) if that's the first field.
      
      Add a similar mac,net test, with MAC address and IPv4 address
      swapped in the set specification.
      Signed-off-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      0de53b0f