1. 24 Jan, 2023 11 commits
  2. 23 Jan, 2023 6 commits
    • Pablo Neira Ayuso's avatar
      netfilter: nft_set_rbtree: skip elements in transaction from garbage collection · 5d235d6c
      Pablo Neira Ayuso authored
      Skip interference with an ongoing transaction, do not perform garbage
      collection on inactive elements. Reset annotated previous end interval
      if the expired element is marked as busy (control plane removed the
      element right before expiration).
      
      Fixes: 8d8540c4 ("netfilter: nft_set_rbtree: add timeout support")
      Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      5d235d6c
    • Pablo Neira Ayuso's avatar
      netfilter: nft_set_rbtree: Switch to node list walk for overlap detection · c9e6978e
      Pablo Neira Ayuso authored
      ...instead of a tree descent, which became overly complicated in an
      attempt to cover cases where expired or inactive elements would affect
      comparisons with the new element being inserted.
      
      Further, it turned out that it's probably impossible to cover all those
      cases, as inactive nodes might entirely hide subtrees consisting of a
      complete interval plus a node that makes the current insertion not
      overlap.
      
      To speed up the overlap check, descent the tree to find a greater
      element that is closer to the key value to insert. Then walk down the
      node list for overlap detection. Starting the overlap check from
      rb_first() unconditionally is slow, it takes 10 times longer due to the
      full linear traversal of the list.
      
      Moreover, perform garbage collection of expired elements when walking
      down the node list to avoid bogus overlap reports.
      
      For the insertion operation itself, this essentially reverts back to the
      implementation before commit 7c84d414 ("netfilter: nft_set_rbtree:
      Detect partial overlaps on insertion"), except that cases of complete
      overlap are already handled in the overlap detection phase itself, which
      slightly simplifies the loop to find the insertion point.
      
      Based on initial patch from Stefano Brivio, including text from the
      original patch description too.
      
      Fixes: 7c84d414 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion")
      Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c9e6978e
    • Gergely Risko's avatar
      ipv6: fix reachability confirmation with proxy_ndp · 9f535c87
      Gergely Risko authored
      When proxying IPv6 NDP requests, the adverts to the initial multicast
      solicits are correct and working.  On the other hand, when later a
      reachability confirmation is requested (on unicast), no reply is sent.
      
      This causes the neighbor entry expiring on the sending node, which is
      mostly a non-issue, as a new multicast request is sent.  There are
      routers, where the multicast requests are intentionally delayed, and in
      these environments the current implementation causes periodic packet
      loss for the proxied endpoints.
      
      The root cause is the erroneous decrease of the hop limit, as this
      is checked in ndisc.c and no answer is generated when it's 254 instead
      of the correct 255.
      
      Cc: stable@vger.kernel.org
      Fixes: 46c7655f ("ipv6: decrease hop limit counter in ip6_forward()")
      Signed-off-by: default avatarGergely Risko <gergely.risko@gmail.com>
      Tested-by: default avatarGergely Risko <gergely.risko@gmail.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f535c87
    • David S. Miller's avatar
      Merge branch 'ethtool-mac-merge' · 0ad999c1
      David S. Miller authored
      Vladimir Oltean say:
      
      ====================
      ethtool support for IEEE 802.3 MAC Merge layer
      
      Change log
      ----------
      
      v3->v4:
      - add missing opening bracket in ocelot_port_mm_irq()
      - moved cfg.verify_time range checking so that it actually takes place
        for the updated rather than old value
      v3 at:
      https://patchwork.kernel.org/project/netdevbpf/cover/20230117085947.2176464-1-vladimir.oltean@nxp.com/
      
      v2->v3:
      - made get_mm return int instead of void
      - deleted ETHTOOL_A_MM_SUPPORTED
      - renamed ETHTOOL_A_MM_ADD_FRAG_SIZE to ETHTOOL_A_MM_TX_MIN_FRAG_SIZE
      - introduced ETHTOOL_A_MM_RX_MIN_FRAG_SIZE
      - cleaned up documentation
      - rebased on top of PLCA changes
      - renamed ETHTOOL_STATS_SRC_* to ETHTOOL_MAC_STATS_SRC_*
      v2 at:
      https://patchwork.kernel.org/project/netdevbpf/cover/20230111161706.1465242-1-vladimir.oltean@nxp.com/
      
      v1->v2:
      I've decided to focus just on the MAC Merge layer for now, which is why
      I am able to submit this patch set as non-RFC.
      v1 (RFC) at:
      https://patchwork.kernel.org/project/netdevbpf/cover/20220816222920.1952936-1-vladimir.oltean@nxp.com/
      
      What is being introduced
      ------------------------
      
      TL;DR: a MAC Merge layer as defined by IEEE 802.3-2018, clause 99
      (interspersing of express traffic). This is controlled through ethtool
      netlink (ETHTOOL_MSG_MM_GET, ETHTOOL_MSG_MM_SET). The raw ethtool
      commands are posted here:
      https://patchwork.kernel.org/project/netdevbpf/cover/20230111153638.1454687-1-vladimir.oltean@nxp.com/
      
      The MAC Merge layer has its own statistics counters
      (ethtool --include-statistics --show-mm swp0) as well as two member
      MACs, the statistics of which can be queried individually, through a new
      ethtool netlink attribute, corresponding to:
      
      $ ethtool -I --show-pause eno2 --src aggregate
      $ ethtool -S eno2 --groups eth-mac eth-phy eth-ctrl rmon -- --src pmac
      
      The core properties of the MAC Merge layer are described in great detail
      in patches 02/12 and 03/12. They can be viewed in "make htmldocs" format.
      
      Devices for which the API is supported
      --------------------------------------
      
      I decided to start with the Ethernet switch on NXP LS1028A (Felix)
      because of the smaller patch set. I also have support for the ENETC
      controller pending.
      
      I would like to get confirmation that the UAPI being proposed here will
      not restrict any use cases known by other hardware vendors.
      
      Why is support for preemptible traffic classes not here?
      --------------------------------------------------------
      
      There is legitimate concern whether the 802.1Q portion of the standard
      (which traffic classes go to the eMAC and which to the pMAC) should be
      modeled in Linux using tc or using another UAPI. I think that is
      stalling the entire series, but should be discussed separately instead.
      Removing FP adminStatus support makes me confident enough to submit this
      patch set without an RFC tag (meaning: I wouldn't mind if it was merged
      as is).
      
      What is submitted here is sufficient for an LLDP daemon to do its job.
      I've patched openlldp to advertise and configure frame preemption:
      https://github.com/vladimiroltean/openlldp/tree/frame-preemption-v3
      
      In case someone wants to try it out, here are some commands I've used.
      
       # Configure the interfaces to receive and transmit LLDP Data Units
       lldptool -L -i eno0 adminStatus=rxtx
       lldptool -L -i swp0 adminStatus=rxtx
       # Enable the transmission of certain TLVs on switch's interface
       lldptool -T -i eno0 -V addEthCap enableTx=yes
       lldptool -T -i swp0 -V addEthCap enableTx=yes
       # Query LLDP statistics on switch's interface
       lldptool -S -i swp0
       # Query the received neighbor TLVs
       lldptool -i swp0 -t -n -V addEthCap
       Additional Ethernet Capabilities TLV
               Preemption capability supported
               Preemption capability enabled
               Preemption capability active
               Additional fragment size: 60 octets
      
      So using this patch set, lldpad will be able to advertise and configure
      frame preemption, but still, no data packet will be sent as preemptible
      over the link, because there is no UAPI to control which traffic classes
      are sent as preemptible and which as express.
      
      Preemptable or preemptible?
      ---------------------------
      
      IEEE 802.3 uses "preemptable" throughout. IEEE 802.1Q uses "preemptible"
      throughout. Because the definition of "preemptible" falls under 802.1Q's
      jurisdiction and 802.3 just references it, I went with the 802.1Q naming
      even where supporting an 802.3 feature. Also, checkpatch agrees with this.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0ad999c1
    • Vladimir Oltean's avatar
      net: ethtool: netlink: introduce ethnl_update_bool() · 7c494a77
      Vladimir Oltean authored
      Due to the fact that the kernel-side data structures have been carried
      over from the ioctl-based ethtool, we are now in the situation where we
      have an ethnl_update_bool32() function, but the plain function that
      operates on a boolean value kept in an actual u8 netlink attribute
      doesn't exist.
      
      With new ethtool features that are exposed solely over netlink, the
      kernel data structures will use the "bool" type, so we will need this
      kind of helper. Introduce it now; it's needed for things like
      verify-disabled for the MAC merge configuration.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7c494a77
    • Wei Fang's avatar
      net: fec: Use page_pool_put_full_page when freeing rx buffers · e38553bd
      Wei Fang authored
      The page_pool_release_page was used when freeing rx buffers, and this
      function just unmaps the page (if mapped) and does not recycle the page.
      So after hundreds of down/up the eth0, the system will out of memory.
      For more details, please refer to the following reproduce steps and
      bug logs. To solve this issue and refer to the doc of page pool, the
      page_pool_put_full_page should be used to replace page_pool_release_page.
      Because this API will try to recycle the page if the page refcnt equal to
      1. After testing 20000 times, the issue can not be reproduced anymore
      (about testing 391 times the issue will occur on i.MX8MN-EVK before).
      
      Reproduce steps:
      Create the test script and run the script. The script content is as
      follows:
      LOOPS=20000
      i=1
      while [ $i -le $LOOPS ]
      do
          echo "TINFO:ENET $curface up and down test $i times"
          org_macaddr=$(cat /sys/class/net/eth0/address)
          ifconfig eth0 down
          ifconfig eth0  hw ether $org_macaddr up
          i=$(expr $i + 1)
      done
      sleep 5
      if cat /sys/class/net/eth0/operstate | grep 'up';then
          echo "TEST PASS"
      else
          echo "TEST FAIL"
      fi
      
      Bug detail logs:
      TINFO:ENET  up and down test 391 times
      [  850.471205] Qualcomm Atheros AR8031/AR8033 30be0000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=30be0000.ethernet-1:00, irq=POLL)
      [  853.535318] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
      [  853.541694] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
      [  870.590531] page_pool_release_retry() stalled pool shutdown 199 inflight 60 sec
      [  931.006557] page_pool_release_retry() stalled pool shutdown 199 inflight 120 sec
      TINFO:ENET  up and down test 392 times
      [  991.426544] page_pool_release_retry() stalled pool shutdown 192 inflight 181 sec
      [ 1051.838531] page_pool_release_retry() stalled pool shutdown 170 inflight 241 sec
      [ 1093.751217] Qualcomm Atheros AR8031/AR8033 30be0000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=30be0000.ethernet-1:00, irq=POLL)
      [ 1096.446520] page_pool_release_retry() stalled pool shutdown 308 inflight 60 sec
      [ 1096.831245] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
      [ 1096.839092] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
      [ 1112.254526] page_pool_release_retry() stalled pool shutdown 103 inflight 302 sec
      [ 1156.862533] page_pool_release_retry() stalled pool shutdown 308 inflight 120 sec
      [ 1172.674516] page_pool_release_retry() stalled pool shutdown 103 inflight 362 sec
      [ 1217.278532] page_pool_release_retry() stalled pool shutdown 308 inflight 181 sec
      TINFO:ENET  up and down test 393 times
      [ 1233.086535] page_pool_release_retry() stalled pool shutdown 103 inflight 422 sec
      [ 1277.698513] page_pool_release_retry() stalled pool shutdown 308 inflight 241 sec
      [ 1293.502525] page_pool_release_retry() stalled pool shutdown 86 inflight 483 sec
      [ 1338.110518] page_pool_release_retry() stalled pool shutdown 308 inflight 302 sec
      [ 1353.918540] page_pool_release_retry() stalled pool shutdown 32 inflight 543 sec
      [ 1361.179205] Qualcomm Atheros AR8031/AR8033 30be0000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=30be0000.ethernet-1:00, irq=POLL)
      [ 1364.255298] fec 30be0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
      [ 1364.263189] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
      [ 1371.998532] page_pool_release_retry() stalled pool shutdown 310 inflight 60 sec
      [ 1398.530542] page_pool_release_retry() stalled pool shutdown 308 inflight 362 sec
      [ 1414.334539] page_pool_release_retry() stalled pool shutdown 16 inflight 604 sec
      [ 1432.414520] page_pool_release_retry() stalled pool shutdown 310 inflight 120 sec
      [ 1458.942523] page_pool_release_retry() stalled pool shutdown 308 inflight 422 sec
      [ 1474.750521] page_pool_release_retry() stalled pool shutdown 16 inflight 664 sec
      TINFO:ENET  up and down test 394 times
      [ 1492.830522] page_pool_release_retry() stalled pool shutdown 310 inflight 181 sec
      [ 1519.358519] page_pool_release_retry() stalled pool shutdown 308 inflight 483 sec
      [ 1535.166545] page_pool_release_retry() stalled pool shutdown 2 inflight 724 sec
      [ 1537.090278] eth_test2.sh invoked oom-killer: gfp_mask=0x400dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO), order=0, oom_score_adj=0
      [ 1537.101192] CPU: 3 PID: 2379 Comm: eth_test2.sh Tainted: G         C         6.1.1+g56321e101aca #1
      [ 1537.110249] Hardware name: NXP i.MX8MNano EVK board (DT)
      [ 1537.115561] Call trace:
      [ 1537.118005]  dump_backtrace.part.0+0xe0/0xf0
      [ 1537.122289]  show_stack+0x18/0x40
      [ 1537.125608]  dump_stack_lvl+0x64/0x80
      [ 1537.129276]  dump_stack+0x18/0x34
      [ 1537.132592]  dump_header+0x44/0x208
      [ 1537.136083]  oom_kill_process+0x2b4/0x2c0
      [ 1537.140097]  out_of_memory+0xe4/0x594
      [ 1537.143766]  __alloc_pages+0xb68/0xd00
      [ 1537.147521]  alloc_pages+0xac/0x160
      [ 1537.151013]  __get_free_pages+0x14/0x40
      [ 1537.154851]  pgd_alloc+0x1c/0x30
      [ 1537.158082]  mm_init+0xf8/0x1d0
      [ 1537.161228]  mm_alloc+0x48/0x60
      [ 1537.164368]  alloc_bprm+0x7c/0x240
      [ 1537.167777]  do_execveat_common.isra.0+0x70/0x240
      [ 1537.172486]  __arm64_sys_execve+0x40/0x54
      [ 1537.176502]  invoke_syscall+0x48/0x114
      [ 1537.180255]  el0_svc_common.constprop.0+0xcc/0xec
      [ 1537.184964]  do_el0_svc+0x2c/0xd0
      [ 1537.188280]  el0_svc+0x2c/0x84
      [ 1537.191340]  el0t_64_sync_handler+0xf4/0x120
      [ 1537.195613]  el0t_64_sync+0x18c/0x190
      [ 1537.199334] Mem-Info:
      [ 1537.201620] active_anon:342 inactive_anon:10343 isolated_anon:0
      [ 1537.201620]  active_file:54 inactive_file:112 isolated_file:0
      [ 1537.201620]  unevictable:0 dirty:0 writeback:0
      [ 1537.201620]  slab_reclaimable:2620 slab_unreclaimable:7076
      [ 1537.201620]  mapped:1489 shmem:2473 pagetables:466
      [ 1537.201620]  sec_pagetables:0 bounce:0
      [ 1537.201620]  kernel_misc_reclaimable:0
      [ 1537.201620]  free:136672 free_pcp:96 free_cma:129241
      [ 1537.240419] Node 0 active_anon:1368kB inactive_anon:41372kB active_file:216kB inactive_file:5052kB unevictable:0kB isolated(anon):0kB isolated(file):0kB s
      [ 1537.271422] Node 0 DMA free:541636kB boost:0kB min:30000kB low:37500kB high:45000kB reserved_highatomic:0KB active_anon:1368kB inactive_anon:41372kB actiB
      [ 1537.300219] lowmem_reserve[]: 0 0 0 0
      [ 1537.303929] Node 0 DMA: 1015*4kB (UMEC) 743*8kB (UMEC) 417*16kB (UMEC) 235*32kB (UMEC) 116*64kB (UMEC) 25*128kB (UMEC) 4*256kB (UC) 2*512kB (UC) 0*1024kBB
      [ 1537.323938] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
      [ 1537.332708] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=32768kB
      [ 1537.341292] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
      [ 1537.349776] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
      [ 1537.358087] 2939 total pagecache pages
      [ 1537.361876] 0 pages in swap cache
      [ 1537.365229] Free swap  = 0kB
      [ 1537.368147] Total swap = 0kB
      [ 1537.371065] 516096 pages RAM
      [ 1537.373959] 0 pages HighMem/MovableOnly
      [ 1537.377834] 17302 pages reserved
      [ 1537.381103] 163840 pages cma reserved
      [ 1537.384809] 0 pages hwpoisoned
      [ 1537.387902] Tasks state (memory values in pages):
      [ 1537.392652] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
      [ 1537.401356] [    201]   993   201     1130       72    45056        0             0 rpcbind
      [ 1537.409772] [    202]     0   202     4529     1640    77824        0          -250 systemd-journal
      [ 1537.418861] [    222]     0   222     4691      801    69632        0         -1000 systemd-udevd
      [ 1537.427787] [    248]   994   248    20914      130    65536        0             0 systemd-timesyn
      [ 1537.436884] [    497]     0   497      620       31    49152        0             0 atd
      [ 1537.444938] [    500]     0   500      854       77    53248        0             0 crond
      [ 1537.453165] [    503]   997   503     1470      160    49152        0          -900 dbus-daemon
      [ 1537.461908] [    505]     0   505      633       24    40960        0             0 firmwared
      [ 1537.470491] [    513]     0   513     2507      180    61440        0             0 ofonod
      [ 1537.478800] [    514]   990   514    69640      137    81920        0             0 parsec
      [ 1537.487120] [    533]     0   533      599       39    40960        0             0 syslogd
      [ 1537.495518] [    534]     0   534     4546      148    65536        0             0 systemd-logind
      [ 1537.504560] [    535]     0   535      690       24    45056        0             0 tee-supplicant
      [ 1537.513564] [    540]   996   540     2769      168    61440        0             0 systemd-network
      [ 1537.522680] [    566]     0   566     3878      228    77824        0             0 connmand
      [ 1537.531168] [    645]   998   645     1538      133    57344        0             0 avahi-daemon
      [ 1537.540004] [    646]   998   646     1461       64    57344        0             0 avahi-daemon
      [ 1537.548846] [    648]   992   648      781       41    45056        0             0 rpc.statd
      [ 1537.557415] [    650] 64371   650      590       23    45056        0             0 ninfod
      [ 1537.565754] [    653] 61563   653      555       24    45056        0             0 rdisc
      [ 1537.573971] [    655]     0   655   374569     2999   290816        0          -999 containerd
      [ 1537.582621] [    658]     0   658     1311       20    49152        0             0 agetty
      [ 1537.590922] [    663]     0   663     1529       97    49152        0             0 login
      [ 1537.599138] [    666]     0   666     3430      202    69632        0             0 wpa_supplicant
      [ 1537.608147] [    667]     0   667     2344       96    61440        0             0 systemd-userdbd
      [ 1537.617240] [    677]     0   677     2964      314    65536        0           100 systemd
      [ 1537.625651] [    679]     0   679     3720      646    73728        0           100 (sd-pam)
      [ 1537.634138] [    687]     0   687     1289      403    45056        0             0 sh
      [ 1537.642108] [    789]     0   789      970       93    45056        0             0 eth_test2.sh
      [ 1537.650955] [   2355]     0  2355     2346       94    61440        0             0 systemd-userwor
      [ 1537.660046] [   2356]     0  2356     2346       94    61440        0             0 systemd-userwor
      [ 1537.669137] [   2358]     0  2358     2346       95    57344        0             0 systemd-userwor
      [ 1537.678258] [   2379]     0  2379      970       93    45056        0             0 eth_test2.sh
      [ 1537.687098] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-0.slice/user@0.service,tas0
      [ 1537.703009] Out of memory: Killed process 679 ((sd-pam)) total-vm:14880kB, anon-rss:2584kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:72kB oom_score_ad0
      [ 1553.246526] page_pool_release_retry() stalled pool shutdown 310 inflight 241 sec
      
      Fixes: 95698ff6 ("net: fec: using page pool to manage RX buffers")
      Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
      Reviewed-by: default avatarshenwei wang <Shenwei.wang@nxp.com>
      Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e38553bd
  3. 21 Jan, 2023 4 commits
  4. 20 Jan, 2023 16 commits
    • Linus Torvalds's avatar
      Merge tag 'net-6.2-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 5deaa985
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from wireless, bluetooth, bpf and netfilter.
      
        Current release - regressions:
      
         - Revert "net: team: use IFF_NO_ADDRCONF flag to prevent ipv6
           addrconf", fix nsna_ping mode of team
      
         - wifi: mt76: fix bugs in Rx queue handling and DMA mapping
      
         - eth: mlx5:
            - add missing mutex_unlock in error reporter
            - protect global IPsec ASO with a lock
      
        Current release - new code bugs:
      
         - rxrpc: fix wrong error return in rxrpc_connect_call()
      
        Previous releases - regressions:
      
         - bluetooth: hci_sync: fix use of HCI_OP_LE_READ_BUFFER_SIZE_V2
      
         - wifi:
            - mac80211: fix crashes on Rx due to incorrect initialization of
              rx->link and rx->link_sta
            - mac80211: fix bugs in iTXQ conversion - Tx stalls, incorrect
              aggregation handling, crashes
            - brcmfmac: fix regression for Broadcom PCIe wifi devices
            - rndis_wlan: prevent buffer overflow in rndis_query_oid
      
         - netfilter: conntrack: handle tcp challenge acks during connection
           reuse
      
         - sched: avoid grafting on htb_destroy_class_offload when destroying
      
         - virtio-net: correctly enable callback during start_xmit, fix stalls
      
         - tcp: avoid the lookup process failing to get sk in ehash table
      
         - ipa: disable ipa interrupt during suspend
      
         - eth: stmmac: enable all safety features by default
      
        Previous releases - always broken:
      
         - bpf:
            - fix pointer-leak due to insufficient speculative store bypass
              mitigation (Spectre v4)
            - skip task with pid=1 in send_signal_common() to avoid a splat
            - fix BPF program ID information in BPF_AUDIT_UNLOAD as well as
              PERF_BPF_EVENT_PROG_UNLOAD events
            - fix potential deadlock in htab_lock_bucket from same bucket
              index but different map_locked index
      
         - bluetooth:
            - fix a buffer overflow in mgmt_mesh_add()
            - hci_qca: fix driver shutdown on closed serdev
            - ISO: fix possible circular locking dependency
            - CIS: hci_event: fix invalid wait context
      
         - wifi: brcmfmac: fixes for survey dump handling
      
         - mptcp: explicitly specify sock family at subflow creation time
      
         - netfilter: nft_payload: incorrect arithmetics when fetching VLAN
           header bits
      
         - tcp: fix rate_app_limited to default to 1
      
         - l2tp: close all race conditions in l2tp_tunnel_register()
      
         - eth: mlx5: fixes for QoS config and eswitch configuration
      
         - eth: enetc: avoid deadlock in enetc_tx_onestep_tstamp()
      
         - eth: stmmac: fix invalid call to mdiobus_get_phy()
      
        Misc:
      
         - ethtool: add netlink attr in rss get reply only if the value is not
           empty"
      
      * tag 'net-6.2-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (88 commits)
        Revert "Merge branch 'octeontx2-af-CPT'"
        tcp: fix rate_app_limited to default to 1
        bnxt: Do not read past the end of test names
        net: stmmac: enable all safety features by default
        octeontx2-af: add mbox to return CPT_AF_FLT_INT info
        octeontx2-af: update cpt lf alloc mailbox
        octeontx2-af: restore rxc conf after teardown sequence
        octeontx2-af: optimize cpt pf identification
        octeontx2-af: modify FLR sequence for CPT
        octeontx2-af: add mbox for CPT LF reset
        octeontx2-af: recover CPT engine when it gets fault
        net: dsa: microchip: ksz9477: port map correction in ALU table entry register
        selftests/net: toeplitz: fix race on tpacket_v3 block close
        net/ulp: use consistent error code when blocking ULP
        octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt
        tcp: avoid the lookup process failing to get sk in ehash table
        Revert "net: team: use IFF_NO_ADDRCONF flag to prevent ipv6 addrconf"
        MAINTAINERS: add networking entries for Willem
        net: sched: gred: prevent races when adding offloads to stats
        l2tp: prevent lockdep issue in l2tp_tunnel_register()
        ...
      5deaa985
    • Stefan Assmann's avatar
      iavf: schedule watchdog immediately when changing primary MAC · e2b53ea5
      Stefan Assmann authored
      iavf_replace_primary_mac() utilizes queue_work() to schedule the
      watchdog task but that only ensures that the watchdog task is queued
      to run. To make sure the watchdog is executed asap use
      mod_delayed_work().
      
      Without this patch it may take up to 2s until the watchdog task gets
      executed, which may cause long delays when setting the MAC address.
      
      Fixes: a3e839d5 ("iavf: Add usage of new virtchnl format to set default MAC")
      Signed-off-by: default avatarStefan Assmann <sassmann@kpanic.de>
      Reviewed-by: default avatarMichal Schmidt <mschmidt@redhat.com>
      Tested-by: default avatarMichal Schmidt <mschmidt@redhat.com>
      Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      e2b53ea5
    • Marcin Szycik's avatar
      iavf: Move netdev_update_features() into watchdog task · 7598f4b4
      Marcin Szycik authored
      Remove netdev_update_features() from iavf_adminq_task(), as it can cause
      deadlocks due to needing rtnl_lock. Instead use the
      IAVF_FLAG_SETUP_NETDEV_FEATURES flag to indicate that netdev features need
      to be updated in the watchdog task. iavf_set_vlan_offload_features()
      and iavf_set_queue_vlan_tag_loc() can be called directly from
      iavf_virtchnl_completion().
      Suggested-by: default avatarPhani Burra <phani.r.burra@intel.com>
      Signed-off-by: default avatarMarcin Szycik <marcin.szycik@linux.intel.com>
      Reviewed-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Tested-by: default avatarMarek Szlosek <marek.szlosek@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      7598f4b4
    • Michal Schmidt's avatar
      iavf: fix temporary deadlock and failure to set MAC address · 4411a608
      Michal Schmidt authored
      We are seeing an issue where setting the MAC address on iavf fails with
      EAGAIN after the 2.5s timeout expires in iavf_set_mac().
      
      There is the following deadlock scenario:
      
      iavf_set_mac(), holding rtnl_lock, waits on:
        iavf_watchdog_task (within iavf_wq) to send a message to the PF,
       and
        iavf_adminq_task (within iavf_wq) to receive a response from the PF.
      In this adapter state (>=__IAVF_DOWN), these tasks do not need to take
      rtnl_lock, but iavf_wq is a global single-threaded workqueue, so they
      may get stuck waiting for another adapter's iavf_watchdog_task to run
      iavf_init_config_adapter(), which does take rtnl_lock.
      
      The deadlock resolves itself by the timeout in iavf_set_mac(),
      which results in EAGAIN returned to userspace.
      
      Let's break the deadlock loop by changing iavf_wq into a per-adapter
      workqueue, so that one adapter's tasks are not blocked by another's.
      
      Fixes: 35a2443d ("iavf: Add waiting for response from PF in set mac")
      Co-developed-by: default avatarIvan Vecera <ivecera@redhat.com>
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
      Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
      Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
      4411a608
    • Jakub Kicinski's avatar
      Revert "Merge branch 'octeontx2-af-CPT'" · 45a919bb
      Jakub Kicinski authored
      This reverts commit b4fbf0b2, reversing
      changes made to 6c977c5c.
      
      This seems like net-next material.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      45a919bb
    • David Morley's avatar
      tcp: fix rate_app_limited to default to 1 · 300b655d
      David Morley authored
      The initial default value of 0 for tp->rate_app_limited was incorrect,
      since a flow is indeed application-limited until it first sends
      data. Fixing the default to be 1 is generally correct but also
      specifically will help user-space applications avoid using the initial
      tcpi_delivery_rate value of 0 that persists until the connection has
      some non-zero bandwidth sample.
      
      Fixes: eb8329e0 ("tcp: export data delivery rate")
      Suggested-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid Morley <morleyd@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Tested-by: default avatarDavid Morley <morleyd@google.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      300b655d
    • Kees Cook's avatar
      bnxt: Do not read past the end of test names · d3e599c0
      Kees Cook authored
      Test names were being concatenated based on a offset beyond the end of
      the first name, which tripped the buffer overflow detection logic:
      
       detected buffer overflow in strnlen
       [...]
       Call Trace:
       bnxt_ethtool_init.cold+0x18/0x18
      
      Refactor struct hwrm_selftest_qlist_output to use an actual array,
      and adjust the concatenation to use snprintf() rather than a series of
      strncat() calls.
      Reported-by: default avatarNiklas Cassel <Niklas.Cassel@wdc.com>
      Link: https://lore.kernel.org/lkml/Y8F%2F1w1AZTvLglFX@x1-carbon/Tested-by: default avatarNiklas Cassel <Niklas.Cassel@wdc.com>
      Fixes: eb513658 ("bnxt_en: Add basic ethtool -t selftest support.")
      Cc: Michael Chan <michael.chan@broadcom.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Reviewed-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d3e599c0
    • Andrew Halaney's avatar
      net: stmmac: enable all safety features by default · fdfc76a1
      Andrew Halaney authored
      In the original implementation of dwmac5
      commit 8bf993a5 ("net: stmmac: Add support for DWMAC5 and implement Safety Features")
      all safety features were enabled by default.
      
      Later it seems some implementations didn't have support for all the
      features, so in
      commit 5ac712dc ("net: stmmac: enable platform specific safety features")
      the safety_feat_cfg structure was added to the callback and defined for
      some platforms to selectively enable these safety features.
      
      The problem is that only certain platforms were given that software
      support. If the automotive safety package bit is set in the hardware
      features register the safety feature callback is called for the platform,
      and for platforms that didn't get a safety_feat_cfg defined this results
      in the following NULL pointer dereference:
      
      [    7.933303] Call trace:
      [    7.935812]  dwmac5_safety_feat_config+0x20/0x170 [stmmac]
      [    7.941455]  __stmmac_open+0x16c/0x474 [stmmac]
      [    7.946117]  stmmac_open+0x38/0x70 [stmmac]
      [    7.950414]  __dev_open+0x100/0x1dc
      [    7.954006]  __dev_change_flags+0x18c/0x204
      [    7.958297]  dev_change_flags+0x24/0x6c
      [    7.962237]  do_setlink+0x2b8/0xfa4
      [    7.965827]  __rtnl_newlink+0x4ec/0x840
      [    7.969766]  rtnl_newlink+0x50/0x80
      [    7.973353]  rtnetlink_rcv_msg+0x12c/0x374
      [    7.977557]  netlink_rcv_skb+0x5c/0x130
      [    7.981500]  rtnetlink_rcv+0x18/0x2c
      [    7.985172]  netlink_unicast+0x2e8/0x340
      [    7.989197]  netlink_sendmsg+0x1a8/0x420
      [    7.993222]  ____sys_sendmsg+0x218/0x280
      [    7.997249]  ___sys_sendmsg+0xac/0x100
      [    8.001103]  __sys_sendmsg+0x84/0xe0
      [    8.004776]  __arm64_sys_sendmsg+0x24/0x30
      [    8.008983]  invoke_syscall+0x48/0x114
      [    8.012840]  el0_svc_common.constprop.0+0xcc/0xec
      [    8.017665]  do_el0_svc+0x38/0xb0
      [    8.021071]  el0_svc+0x2c/0x84
      [    8.024212]  el0t_64_sync_handler+0xf4/0x120
      [    8.028598]  el0t_64_sync+0x190/0x194
      
      Go back to the original behavior, if the automotive safety package
      is found to be supported in hardware enable all the features unless
      safety_feat_cfg is passed in saying this particular platform only
      supports a subset of the features.
      
      Fixes: 5ac712dc ("net: stmmac: enable platform specific safety features")
      Reported-by: default avatarNing Cai <ncai@quicinc.com>
      Signed-off-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdfc76a1
    • David S. Miller's avatar
      Merge branch 'octeontx2-af-CPT' · b4fbf0b2
      David S. Miller authored
      Srujana Challa says:
      
      ====================
      octeontx2-af: Miscellaneous changes for CPT
      
      This patchset consists of miscellaneous changes for CPT.
      - Adds a new mailbox to reset the requested CPT LF.
      - Modify FLR sequence as per HW team suggested.
      - Adds support to recover CPT engines when they gets fault.
      - Updates CPT inbound inline IPsec configuration mailbox,
        as per new generation of the OcteonTX2 chips.
      - Adds a new mailbox to return CPT FLT Interrupt info.
      
      ---
      v2:
      - Addressed a review comment.
      v1:
      - Dropped patch "octeontx2-af: Fix interrupt name strings completely"
        to submit to net.
      ---
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4fbf0b2
    • Srujana Challa's avatar
      octeontx2-af: add mbox to return CPT_AF_FLT_INT info · 8299ffe3
      Srujana Challa authored
      CPT HW would trigger the CPT AF FLT interrupt when CPT engines
      hits some uncorrectable errors and AF is the one which receives
      the interrupt and recovers the engines.
      This patch adds a mailbox for CPT VFs to request for CPT faulted
      and recovered engines info.
      Signed-off-by: default avatarSrujana Challa <schalla@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8299ffe3
    • Srujana Challa's avatar
      octeontx2-af: update cpt lf alloc mailbox · c0688ec0
      Srujana Challa authored
      The CN10K CPT coprocessor contains a context processor
      to accelerate updates to the IPsec security association
      contexts. The context processor contains a context cache.
      This patch updates CPT LF ALLOC mailbox to config ctx_ilen
      requested by VFs. CPT_LF_ALLOC:ctx_ilen is the size of
      initial context fetch.
      Signed-off-by: default avatarSrujana Challa <schalla@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c0688ec0
    • Nithin Dabilpuram's avatar
      octeontx2-af: restore rxc conf after teardown sequence · d5b2e0a2
      Nithin Dabilpuram authored
      CN10K CPT coprocessor includes a component named RXC which
      is responsible for reassembly of inner IP packets. RXC has
      the feature to evict oldest entries based on age/threshold.
      The age/threshold is being set to minimum values to evict
      all entries at the time of teardown.
      This patch adds code to restore timeout and threshold config
      after teardown sequence is complete as it is global config.
      Signed-off-by: default avatarNithin Dabilpuram <ndabilpuram@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d5b2e0a2
    • Srujana Challa's avatar
      octeontx2-af: optimize cpt pf identification · 9adb04ff
      Srujana Challa authored
      Optimize CPT PF identification in mbox handling for faster
      mbox response by doing it at AF driver probe instead of
      every mbox message.
      Signed-off-by: default avatarSrujana Challa <schalla@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9adb04ff
    • Srujana Challa's avatar
      octeontx2-af: modify FLR sequence for CPT · 1286c50a
      Srujana Challa authored
      On OcteonTX2 platform CPT instruction enqueue is only
      possible via LMTST operations.
      The existing FLR sequence mentioned in HRM requires
      a dummy LMTST to CPT but LMTST can't be submitted from
      AF driver. So, HW team provided a new sequence to avoid
      dummy LMTST. This patch adds code for the same.
      Signed-off-by: default avatarSrujana Challa <schalla@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1286c50a
    • Srujana Challa's avatar
      octeontx2-af: add mbox for CPT LF reset · f58cf765
      Srujana Challa authored
      On OcteonTX2 SoC, the admin function (AF) is the only one with all
      priviliges to configure HW and alloc resources, PFs and it's VFs
      have to request AF via mailbox for all their needs.
      This patch adds a new mailbox for CPT VFs to request for CPT LF
      reset.
      Signed-off-by: default avatarSrujana Challa <schalla@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f58cf765
    • Srujana Challa's avatar
      octeontx2-af: recover CPT engine when it gets fault · 07ea567d
      Srujana Challa authored
      When CPT engine has uncorrectable errors, it will get halted and
      must be disabled and re-enabled. This patch adds code for the same.
      Signed-off-by: default avatarSrujana Challa <schalla@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      07ea567d
  5. 19 Jan, 2023 3 commits
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.2-3-2023-01-19' of... · 4a0c7a68
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.2-3-2023-01-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Prevent reading into undefined memory in the expression lexer,
         accounting for a trailer backslash followed by the null byte.
      
       - Fix file mode when copying files to the build id cache, the problem
         happens when the cache directory is in a different file system than
         the file being cached, otherwise the mode was preserved as only a
         hard link would be done to save space.
      
       - Fix a related build-id 'perf test' entry that checked that permission
         when caching PE (Portable Executable) files, used when profiling
         Windows executables under wine.
      
       - Sync the tools/ copies of kvm headers, build_bug.h, socket.h and
         arm64's cputype.h with the kernel sources.
      
      * tag 'perf-tools-fixes-for-v6.2-3-2023-01-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf test build-id: Fix test check for PE file
        perf buildid-cache: Fix the file mode with copyfile() while adding file to build-id cache
        perf expr: Prevent normalize() from reading into undefined memory in the expression lexer
        tools headers: Syncronize linux/build_bug.h with the kernel sources
        perf beauty: Update copy of linux/socket.h with the kernel sources
        tools headers arm64: Sync arm64's cputype.h with the kernel sources
        tools kvm headers arm64: Update KVM header from the kernel sources
        tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
      4a0c7a68
    • Linus Torvalds's avatar
      Merge tag 'printk-for-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · d368967c
      Linus Torvalds authored
      Pull printk fixes from Petr Mladek:
      
       - Prevent a potential deadlock when configuring kgdb console
      
       - Fix a kernel doc warning
      
      * tag 'printk-for-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        kernel/printk/printk.c: Fix W=1 kernel-doc warning
        tty: serial: kgdboc: fix mutex locking order for configure_kgdboc()
      d368967c
    • Linus Torvalds's avatar
      Merge tag 's390-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · a03df4ec
      Linus Torvalds authored
      Pull s390 build fix from Heiko Carstens:
      
       - Workaround invalid gcc-11 out of bounds read warning caused by s390's
         S390_lowcore definition. This happens only with gcc 11.1.0 and
         11.2.0.
      
         The code which causes this warning will be gone with the next merge
         window. Therefore just replace the memcpy() with a for loop to get
         rid of the warning.
      
      * tag 's390-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: workaround invalid gcc-11 out of bounds read warning
      a03df4ec