Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jul 18, 2024
    • Benjamin Coddington's avatar
      SUNRPC: Fix a race to wake a sync task · ed0172af
      Benjamin Coddington authored
      
      We've observed NFS clients with sync tasks sleeping in __rpc_execute
      waiting on RPC_TASK_QUEUED that have not responded to a wake-up from
      rpc_make_runnable().  I suspect this problem usually goes unnoticed,
      because on a busy client the task will eventually be re-awoken by another
      task completion or xprt event.  However, if the state manager is draining
      the slot table, a sync task missing a wake-up can result in a hung client.
      
      We've been able to prove that the waker in rpc_make_runnable() successfully
      calls wake_up_bit() (ie- there's no race to tk_runstate), but the
      wake_up_bit() call fails to wake the waiter.  I suspect the waker is
      missing the load of the bit's wait_queue_head, so waitqueue_active() is
      false.  There are some very helpful comments about this problem above
      wake_up_bit(), prepare_to_wait(), and waitqueue_active().
      
      Fix this by inserting smp_mb__after_atomic() before the wake_up_bit(),
      which pairs with prepare_to_wait() calling set_current_state().
      
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      ed0172af
    • Ido Schimmel's avatar
      ipv4: Fix incorrect TOS in fibmatch route get reply · f036e682
      Ido Schimmel authored
      The TOS value that is returned to user space in the route get reply is
      the one with which the lookup was performed ('fl4->flowi4_tos'). This is
      fine when the matched route is configured with a TOS as it would not
      match if its TOS value did not match the one with which the lookup was
      performed.
      
      However, matching on TOS is only performed when the route's TOS is not
      zero. It is therefore possible to have the kernel incorrectly return a
      non-zero TOS:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get fibmatch 192.0.2.2 tos 0xfc
       192.0.2.0/24 tos 0x1c dev dummy1 proto kernel scope link src 192.0.2.1
      
      Fix by instead returning the DSCP field from the FIB result structure
      which was populated during the route lookup.
      
      Output after the patch:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get fibmatch 192.0.2.2 tos 0xfc
       192.0.2.0/24 dev dummy1 proto kernel scope link src 192.0.2.1
      
      Extend the existing selftests to not only verify that the correct route
      is returned, but that it is also returned with correct "tos" value (or
      without it).
      
      Fixes: b6179813
      
       ("net: ipv4: RTM_GETROUTE: return matched fib result when requested")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      f036e682
    • Ido Schimmel's avatar
      ipv4: Fix incorrect TOS in route get reply · 338bb57e
      Ido Schimmel authored
      The TOS value that is returned to user space in the route get reply is
      the one with which the lookup was performed ('fl4->flowi4_tos'). This is
      fine when the matched route is configured with a TOS as it would not
      match if its TOS value did not match the one with which the lookup was
      performed.
      
      However, matching on TOS is only performed when the route's TOS is not
      zero. It is therefore possible to have the kernel incorrectly return a
      non-zero TOS:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get 192.0.2.2 tos 0xfc
       192.0.2.2 tos 0x1c dev dummy1 src 192.0.2.1 uid 0
           cache
      
      Fix by adding a DSCP field to the FIB result structure (inside an
      existing 4 bytes hole), populating it in the route lookup and using it
      when filling the route get reply.
      
      Output after the patch:
      
       # ip link add name dummy1 up type dummy
       # ip address add 192.0.2.1/24 dev dummy1
       # ip route get 192.0.2.2 tos 0xfc
       192.0.2.2 dev dummy1 src 192.0.2.1 uid 0
           cache
      
      Fixes: 1a00fee4
      
       ("ipv4: Remove rt_key_{src,dst,tos} from struct rtable.")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Reviewed-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      338bb57e
    • Pablo Neira Ayuso's avatar
      net: flow_dissector: use DEBUG_NET_WARN_ON_ONCE · 120f1c85
      Pablo Neira Ayuso authored
      The following splat is easy to reproduce upstream as well as in -stable
      kernels. Florian Westphal provided the following commit:
      
        d1dab4f7 ("net: add and use __skb_get_hash_symmetric_net")
      
      but this complementary fix has been also suggested by Willem de Bruijn
      and it can be easily backported to -stable kernel which consists in
      using DEBUG_NET_WARN_ON_ONCE instead to silence the following splat
      given __skb_get_hash() is used by the nftables tracing infrastructure to
      to identify packets in traces.
      
      [69133.561393] ------------[ cut here ]------------
      [69133.561404] WARNING: CPU: 0 PID: 43576 at net/core/flow_dissector.c:1104 __skb_flow_dissect+0x134f/
      [...]
      [69133.561944] CPU: 0 PID: 43576 Comm: socat Not tainted 6.10.0-rc7+ #379
      [69133.561959] RIP: 0010:__skb_flow_dissect+0x134f/0x2ad0
      [69133.561970] Code: 83 f9 04 0f 84 b3 00 00 00 45 85 c9 0f 84 aa 00 00 00 41 83 f9 02 0f 84 81 fc ff
      ff 44 0f b7 b4 24 80 00 00 00 e9 8b f9 ff ff <0f> 0b e9 20 f3 ff ff 41 f6 c6 20 0f 84 e4 ef ff ff 48 8d 7b 12 e8
      [69133.561979] RSP: 0018:ffffc90000006fc0 EFLAGS: 00010246
      [69133.561988] RAX: 0000000000000000 RBX: ffffffff82f33e20 RCX: ffffffff81ab7e19
      [69133.561994] RDX: dffffc0000000000 RSI: ffffc90000007388 RDI: ffff888103a1b418
      [69133.562001] RBP: ffffc90000007310 R08: 0000000000000000 R09: 0000000000000000
      [69133.562007] R10: ffffc90000007388 R11: ffffffff810cface R12: ffff888103a1b400
      [69133.562013] R13: 0000000000000000 R14: ffffffff82f33e2a R15: ffffffff82f33e28
      [69133.562020] FS:  00007f40f7131740(0000) GS:ffff888390800000(0000) knlGS:0000000000000000
      [69133.562027] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [69133.562033] CR2: 00007f40f7346ee0 CR3: 000000015d200001 CR4: 00000000001706f0
      [69133.562040] Call Trace:
      [69133.562044]  <IRQ>
      [69133.562049]  ? __warn+0x9f/0x1a0
      [ 1211.841384]  ? __skb_flow_dissect+0x107e/0x2860
      [...]
      [ 1211.841496]  ? bpf_flow_dissect+0x160/0x160
      [ 1211.841753]  __skb_get_hash+0x97/0x280
      [ 1211.841765]  ? __skb_get_hash_symmetric+0x230/0x230
      [ 1211.841776]  ? mod_find+0xbf/0xe0
      [ 1211.841786]  ? get_stack_info_noinstr+0x12/0xe0
      [ 1211.841798]  ? bpf_ksym_find+0x56/0xe0
      [ 1211.841807]  ? __rcu_read_unlock+0x2a/0x70
      [ 1211.841819]  nft_trace_init+0x1b9/0x1c0 [nf_tables]
      [ 1211.841895]  ? nft_trace_notify+0x830/0x830 [nf_tables]
      [ 1211.841964]  ? get_stack_info+0x2b/0x80
      [ 1211.841975]  ? nft_do_chain_arp+0x80/0x80 [nf_tables]
      [ 1211.842044]  nft_do_chain+0x79c/0x850 [nf_tables]
      
      Fixes: 9b52e3f2
      
       ("flow_dissector: handle no-skb use case")
      Suggested-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://patch.msgid.link/20240715141442.43775-1-pablo@netfilter.org
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      120f1c85
  2. Jul 17, 2024
  3. Jul 16, 2024
    • Kees Cook's avatar
      tcp: Replace strncpy() with strscpy() · a3bfc095
      Kees Cook authored
      Replace the deprecated[1] uses of strncpy() in tcp_ca_get_name_by_key()
      and tcp_get_default_congestion_control(). The callers use the results as
      standard C strings (via nla_put_string() and proc handlers respectively),
      so trailing padding is not needed.
      
      Since passing the destination buffer arguments decays it to a pointer,
      the size can't be trivially determined by the compiler. ca->name is
      the same length in both cases, so strscpy() won't fail (when ca->name
      is NUL-terminated). Include the length explicitly instead of using the
      2-argument strscpy().
      
      Link: https://github.com/KSPP/linux/issues/90
      
       [1]
      Signed-off-by: default avatarKees Cook <kees@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://patch.msgid.link/20240714041111.it.918-kees@kernel.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a3bfc095
    • Kuniyuki Iwashima's avatar
      tcp: Don't access uninit tcp_rsk(req)->ao_keyid in tcp_create_openreq_child(). · 3f451813
      Kuniyuki Iwashima authored
      syzkaller reported KMSAN splat in tcp_create_openreq_child(). [0]
      
      The uninit variable is tcp_rsk(req)->ao_keyid.
      
      tcp_rsk(req)->ao_keyid is initialised only when tcp_conn_request() finds
      a valid TCP AO option in SYN.  Then, tcp_rsk(req)->used_tcp_ao is set
      accordingly.
      
      Let's not read tcp_rsk(req)->ao_keyid when tcp_rsk(req)->used_tcp_ao is
      false.
      
      [0]:
      BUG: KMSAN: uninit-value in tcp_create_openreq_child+0x198b/0x1ff0 net/ipv4/tcp_minisocks.c:610
       tcp_create_openreq_child+0x198b/0x1ff0 net/ipv4/tcp_minisocks.c:610
       tcp_v4_syn_recv_sock+0x18e/0x2170 net/ipv4/tcp_ipv4.c:1754
       tcp_check_req+0x1a3e/0x20c0 net/ipv4/tcp_minisocks.c:852
       tcp_v4_rcv+0x26a4/0x53a0 net/ipv4/tcp_ipv4.c:2265
       ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205
       ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233
       NF_HOOK include/linux/netfilter.h:314 [inline]
       ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254
       dst_input include/net/dst.h:460 [inline]
       ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
       ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline]
       ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639
       ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674
       __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline]
       __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751
       __netif_receive_skb_list net/core/dev.c:5803 [inline]
       netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895
       gro_normal_list include/net/gro.h:515 [inline]
       napi_complete_done+0x3f2/0x990 net/core/dev.c:6246
       e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808
       __napi_poll+0xd9/0x990 net/core/dev.c:6771
       napi_poll net/core/dev.c:6840 [inline]
       net_rx_action+0x90f/0x17e0 net/core/dev.c:6962
       handle_softirqs+0x152/0x6b0 kernel/softirq.c:554
       __do_softirq kernel/softirq.c:588 [inline]
       invoke_softirq kernel/softirq.c:428 [inline]
       __irq_exit_rcu kernel/softirq.c:637 [inline]
       irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649
       common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
       __msan_instrument_asm_store+0xd6/0xe0
       arch_atomic_inc arch/x86/include/asm/atomic.h:53 [inline]
       raw_atomic_inc include/linux/atomic/atomic-arch-fallback.h:992 [inline]
       atomic_inc include/linux/atomic/atomic-instrumented.h:436 [inline]
       page_ref_inc include/linux/page_ref.h:153 [inline]
       folio_ref_inc include/linux/page_ref.h:160 [inline]
       filemap_map_order0_folio mm/filemap.c:3596 [inline]
       filemap_map_pages+0x11c7/0x2270 mm/filemap.c:3644
       do_fault_around mm/memory.c:4879 [inline]
       do_read_fault mm/memory.c:4912 [inline]
       do_fault mm/memory.c:5051 [inline]
       do_pte_missing mm/memory.c:3897 [inline]
       handle_pte_fault mm/memory.c:5381 [inline]
       __handle_mm_fault mm/memory.c:5524 [inline]
       handle_mm_fault+0x3677/0x6f00 mm/memory.c:5689
       do_user_addr_fault+0x1373/0x2b20 arch/x86/mm/fault.c:1338
       handle_page_fault arch/x86/mm/fault.c:1481 [inline]
       exc_page_fault+0x54/0xc0 arch/x86/mm/fault.c:1539
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
      
      Uninit was stored to memory at:
       tcp_create_openreq_child+0x1984/0x1ff0 net/ipv4/tcp_minisocks.c:611
       tcp_v4_syn_recv_sock+0x18e/0x2170 net/ipv4/tcp_ipv4.c:1754
       tcp_check_req+0x1a3e/0x20c0 net/ipv4/tcp_minisocks.c:852
       tcp_v4_rcv+0x26a4/0x53a0 net/ipv4/tcp_ipv4.c:2265
       ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205
       ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233
       NF_HOOK include/linux/netfilter.h:314 [inline]
       ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254
       dst_input include/net/dst.h:460 [inline]
       ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
       ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline]
       ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639
       ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674
       __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline]
       __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751
       __netif_receive_skb_list net/core/dev.c:5803 [inline]
       netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895
       gro_normal_list include/net/gro.h:515 [inline]
       napi_complete_done+0x3f2/0x990 net/core/dev.c:6246
       e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808
       __napi_poll+0xd9/0x990 net/core/dev.c:6771
       napi_poll net/core/dev.c:6840 [inline]
       net_rx_action+0x90f/0x17e0 net/core/dev.c:6962
       handle_softirqs+0x152/0x6b0 kernel/softirq.c:554
       __do_softirq kernel/softirq.c:588 [inline]
       invoke_softirq kernel/softirq.c:428 [inline]
       __irq_exit_rcu kernel/softirq.c:637 [inline]
       irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649
       common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
      
      Uninit was created at:
       __alloc_pages_noprof+0x82d/0xcb0 mm/page_alloc.c:4706
       __alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
       alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
       alloc_slab_page mm/slub.c:2265 [inline]
       allocate_slab mm/slub.c:2428 [inline]
       new_slab+0x2af/0x14e0 mm/slub.c:2481
       ___slab_alloc+0xf73/0x3150 mm/slub.c:3667
       __slab_alloc mm/slub.c:3757 [inline]
       __slab_alloc_node mm/slub.c:3810 [inline]
       slab_alloc_node mm/slub.c:3990 [inline]
       kmem_cache_alloc_noprof+0x53a/0x9f0 mm/slub.c:4009
       reqsk_alloc_noprof net/ipv4/inet_connection_sock.c:920 [inline]
       inet_reqsk_alloc+0x63/0x700 net/ipv4/inet_connection_sock.c:951
       tcp_conn_request+0x339/0x4860 net/ipv4/tcp_input.c:7177
       tcp_v4_conn_request+0x13b/0x190 net/ipv4/tcp_ipv4.c:1719
       tcp_rcv_state_process+0x2dd/0x4a10 net/ipv4/tcp_input.c:6711
       tcp_v4_do_rcv+0xbee/0x10d0 net/ipv4/tcp_ipv4.c:1932
       tcp_v4_rcv+0x3fad/0x53a0 net/ipv4/tcp_ipv4.c:2334
       ip_protocol_deliver_rcu+0x884/0x1270 net/ipv4/ip_input.c:205
       ip_local_deliver_finish+0x30f/0x530 net/ipv4/ip_input.c:233
       NF_HOOK include/linux/netfilter.h:314 [inline]
       ip_local_deliver+0x230/0x4c0 net/ipv4/ip_input.c:254
       dst_input include/net/dst.h:460 [inline]
       ip_sublist_rcv_finish net/ipv4/ip_input.c:580 [inline]
       ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline]
       ip_sublist_rcv+0x10f7/0x13e0 net/ipv4/ip_input.c:639
       ip_list_rcv+0x952/0x9c0 net/ipv4/ip_input.c:674
       __netif_receive_skb_list_ptype net/core/dev.c:5703 [inline]
       __netif_receive_skb_list_core+0xd92/0x11d0 net/core/dev.c:5751
       __netif_receive_skb_list net/core/dev.c:5803 [inline]
       netif_receive_skb_list_internal+0xd8f/0x1350 net/core/dev.c:5895
       gro_normal_list include/net/gro.h:515 [inline]
       napi_complete_done+0x3f2/0x990 net/core/dev.c:6246
       e1000_clean+0x1fa4/0x5e50 drivers/net/ethernet/intel/e1000/e1000_main.c:3808
       __napi_poll+0xd9/0x990 net/core/dev.c:6771
       napi_poll net/core/dev.c:6840 [inline]
       net_rx_action+0x90f/0x17e0 net/core/dev.c:6962
       handle_softirqs+0x152/0x6b0 kernel/softirq.c:554
       __do_softirq kernel/softirq.c:588 [inline]
       invoke_softirq kernel/softirq.c:428 [inline]
       __irq_exit_rcu kernel/softirq.c:637 [inline]
       irq_exit_rcu+0x5d/0x120 kernel/softirq.c:649
       common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:278
       asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
      
      CPU: 0 PID: 239 Comm: modprobe Tainted: G    B              6.10.0-rc7-01816-g852e42cc2dd4 #3 1107521f0c7b55c9309062382d0bda9f604dbb6d
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
      
      Fixes: 06b22ef2
      
       ("net/tcp: Wire TCP-AO to request sockets")
      Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
      Link: https://patch.msgid.link/20240714161719.6528-1-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      3f451813
  4. Jul 15, 2024
  5. Jul 14, 2024
    • Taehee Yoo's avatar
      xdp: fix invalid wait context of page_pool_destroy() · 59a931c5
      Taehee Yoo authored
      If the driver uses a page pool, it creates a page pool with
      page_pool_create().
      The reference count of page pool is 1 as default.
      A page pool will be destroyed only when a reference count reaches 0.
      page_pool_destroy() is used to destroy page pool, it decreases a
      reference count.
      When a page pool is destroyed, ->disconnect() is called, which is
      mem_allocator_disconnect().
      This function internally acquires mutex_lock().
      
      If the driver uses XDP, it registers a memory model with
      xdp_rxq_info_reg_mem_model().
      The xdp_rxq_info_reg_mem_model() internally increases a page pool
      reference count if a memory model is a page pool.
      Now the reference count is 2.
      
      To destroy a page pool, the driver should call both page_pool_destroy()
      and xdp_unreg_mem_model().
      The xdp_unreg_mem_model() internally calls page_pool_destroy().
      Only page_pool_destroy() decreases a reference count.
      
      If a driver calls page_pool_destroy() then xdp_unreg_mem_model(), we
      will face an invalid wait context warning.
      Because xdp_unreg_mem_model() calls page_pool_destroy() with
      rcu_read_lock().
      The page_pool_destroy() internally acquires mutex_lock().
      
      Splat looks like:
      =============================
      [ BUG: Invalid wait context ]
      6.10.0-rc6+ #4 Tainted: G W
      -----------------------------
      ethtool/1806 is trying to lock:
      ffffffff90387b90 (mem_id_lock){+.+.}-{4:4}, at: mem_allocator_disconnect+0x73/0x150
      other info that might help us debug this:
      context-{5:5}
      3 locks held by ethtool/1806:
      stack backtrace:
      CPU: 0 PID: 1806 Comm: ethtool Tainted: G W 6.10.0-rc6+ #4 f916f41f172891c800f2fed
      Hardware name: ASUS System Product Name/PRIME Z690-P D4, BIOS 0603 11/01/2021
      Call Trace:
      <TASK>
      dump_stack_lvl+0x7e/0xc0
      __lock_acquire+0x1681/0x4de0
      ? _printk+0x64/0xe0
      ? __pfx_mark_lock.part.0+0x10/0x10
      ? __pfx___lock_acquire+0x10/0x10
      lock_acquire+0x1b3/0x580
      ? mem_allocator_disconnect+0x73/0x150
      ? __wake_up_klogd.part.0+0x16/0xc0
      ? __pfx_lock_acquire+0x10/0x10
      ? dump_stack_lvl+0x91/0xc0
      __mutex_lock+0x15c/0x1690
      ? mem_allocator_disconnect+0x73/0x150
      ? __pfx_prb_read_valid+0x10/0x10
      ? mem_allocator_disconnect+0x73/0x150
      ? __pfx_llist_add_batch+0x10/0x10
      ? console_unlock+0x193/0x1b0
      ? lockdep_hardirqs_on+0xbe/0x140
      ? __pfx___mutex_lock+0x10/0x10
      ? tick_nohz_tick_stopped+0x16/0x90
      ? __irq_work_queue_local+0x1e5/0x330
      ? irq_work_queue+0x39/0x50
      ? __wake_up_klogd.part.0+0x79/0xc0
      ? mem_allocator_disconnect+0x73/0x150
      mem_allocator_disconnect+0x73/0x150
      ? __pfx_mem_allocator_disconnect+0x10/0x10
      ? mark_held_locks+0xa5/0xf0
      ? rcu_is_watching+0x11/0xb0
      page_pool_release+0x36e/0x6d0
      page_pool_destroy+0xd7/0x440
      xdp_unreg_mem_model+0x1a7/0x2a0
      ? __pfx_xdp_unreg_mem_model+0x10/0x10
      ? kfree+0x125/0x370
      ? bnxt_free_ring.isra.0+0x2eb/0x500
      ? bnxt_free_mem+0x5ac/0x2500
      xdp_rxq_info_unreg+0x4a/0xd0
      bnxt_free_mem+0x1356/0x2500
      bnxt_close_nic+0xf0/0x3b0
      ? __pfx_bnxt_close_nic+0x10/0x10
      ? ethnl_parse_bit+0x2c6/0x6d0
      ? __pfx___nla_validate_parse+0x10/0x10
      ? __pfx_ethnl_parse_bit+0x10/0x10
      bnxt_set_features+0x2a8/0x3e0
      __netdev_update_features+0x4dc/0x1370
      ? ethnl_parse_bitset+0x4ff/0x750
      ? __pfx_ethnl_parse_bitset+0x10/0x10
      ? __pfx___netdev_update_features+0x10/0x10
      ? mark_held_locks+0xa5/0xf0
      ? _raw_spin_unlock_irqrestore+0x42/0x70
      ? __pm_runtime_resume+0x7d/0x110
      ethnl_set_features+0x32d/0xa20
      
      To fix this problem, it uses rhashtable_lookup_fast() instead of
      rhashtable_lookup() with rcu_read_lock().
      Using xa without rcu_read_lock() here is safe.
      xa is freed by __xdp_mem_allocator_rcu_free() and this is called by
      call_rcu() of mem_xa_remove().
      The mem_xa_remove() is called by page_pool_destroy() if a reference
      count reaches 0.
      The xa is already protected by the reference count mechanism well in the
      control plane.
      So removing rcu_read_lock() for page_pool_destroy() is safe.
      
      Fixes: c3f812ce
      
       ("page_pool: do not release pool until inflight == 0.")
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://patch.msgid.link/20240712095116.3801586-1-ap420073@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      59a931c5
    • Kamil Horák (2N)'s avatar
      net: phy: bcm54811: New link mode for BroadR-Reach · 2c158329
      Kamil Horák (2N) authored
      
      Introduce a new link mode necessary for 10 MBit single-pair
      connection in BroadR-Reach mode on bcm5481x PHY by Broadcom.
      This new link mode, 10baseT1BRR, is known as 1BR10 in the Broadcom
      terminology. Another link mode to be used is 1BR100 and it is already
      present as 100baseT1, because Broadcom's 1BR100 became 100baseT1
      (IEEE 802.3bw).
      
      Signed-off-by: default avatarKamil Horák (2N) <kamilh@axis.com>
      Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://patch.msgid.link/20240712150709.3134474-2-kamilh@axis.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2c158329