======================================================
WARNING: possible circular locking dependency detected
6.1.92-syzkaller #0 Not tainted
------------------------------------------------------
syz-fuzzer/3544 is trying to acquire lock:
ffff8880b9935e90 (lock#10){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline]
ffff8880b9935e90 (lock#10){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237

but task is already holding lock:
ffff8880b9928358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&base->lock){-.-.}-{2:2}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
       lock_timer_base+0x120/0x260 kernel/time/timer.c:999
       __mod_timer+0x1cb/0xee0 kernel/time/timer.c:1072
       queue_delayed_work_on+0x156/0x250 kernel/workqueue.c:1704
       slab_free_hook mm/slub.c:1699 [inline]
       slab_free_freelist_hook mm/slub.c:1750 [inline]
       slab_free mm/slub.c:3661 [inline]
       kmem_cache_free+0x241/0x510 mm/slub.c:3683
       __sigqueue_free kernel/signal.c:458 [inline]
       collect_signal kernel/signal.c:601 [inline]
       __dequeue_signal+0x4ac/0x5c0 kernel/signal.c:623
       dequeue_signal+0x165/0x590 kernel/signal.c:646
       signalfd_dequeue fs/signalfd.c:163 [inline]
       signalfd_read+0x3b3/0x1580 fs/signalfd.c:217
       vfs_read+0x2ed/0xbe0 fs/read_write.c:468
       ksys_read+0x19c/0x2c0 fs/read_write.c:613
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&sighand->siglock){-.-.}-{2:2}:
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
       __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410
       lock_task_sighand include/linux/sched/signal.h:745 [inline]
       do_send_sig_info kernel/signal.c:1299 [inline]
       group_send_sig_info+0x26c/0x300 kernel/signal.c:1448
       bpf_send_signal_common+0x2d8/0x420 kernel/trace/bpf_trace.c:882
       ____bpf_send_signal_thread kernel/trace/bpf_trace.c:899 [inline]
       bpf_send_signal_thread+0x12/0x20 kernel/trace/bpf_trace.c:897
       bpf_prog_7bb747c56a8bcba8+0x15/0x1d
       bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
       __bpf_prog_run include/linux/filter.h:603 [inline]
       bpf_prog_run include/linux/filter.h:610 [inline]
       __bpf_trace_run kernel/trace/bpf_trace.c:2273 [inline]
       bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2314
       trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:52 [inline]
       __mmap_lock_do_trace_acquire_returned+0x5e3/0x670 mm/mmap_lock.c:237
       __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
       mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
       get_mmap_lock_carefully mm/memory.c:5304 [inline]
       lock_mm_and_find_vma+0x219/0x2e0 mm/memory.c:5366
       do_user_addr_fault arch/x86/mm/fault.c:1343 [inline]
       handle_page_fault arch/x86/mm/fault.c:1462 [inline]
       exc_page_fault+0x169/0x660 arch/x86/mm/fault.c:1518
       asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570

-> #0 (lock#10){+.+.}-{2:2}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
       __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
       lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
       local_lock_acquire include/linux/local_lock_internal.h:29 [inline]
       __mmap_lock_do_trace_acquire_returned+0x9d/0x670 mm/mmap_lock.c:237
       __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
       mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
       stack_map_get_build_id_offset+0x99e/0x9c0 kernel/bpf/stackmap.c:144
       __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:452
       bpf_prog_e6cf5f9c69743609+0x3a/0x3e
       bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
       __bpf_prog_run include/linux/filter.h:603 [inline]
       bpf_prog_run include/linux/filter.h:610 [inline]
       bpf_prog_run_array include/linux/bpf.h:1635 [inline]
       trace_call_bpf+0x345/0x6a0 kernel/trace/bpf_trace.c:135
       perf_trace_run_bpf_submit+0x7b/0x1d0 kernel/events/core.c:9924
       perf_trace_timer_class+0x2c8/0x380 include/trace/events/timer.h:12
       trace_timer_cancel include/trace/events/timer.h:138 [inline]
       debug_deactivate kernel/time/timer.c:832 [inline]
       detach_timer+0x2f4/0x380 kernel/time/timer.c:878
       detach_if_pending kernel/time/timer.c:899 [inline]
       __mod_timer+0x407/0xee0 kernel/time/timer.c:1076
       sk_reset_timer+0x1f/0xb0 net/core/sock.c:3371
       inet_csk_reset_xmit_timer include/net/inet_connection_sock.h:234 [inline]
       tcp_reset_xmit_timer include/net/tcp.h:1347 [inline]
       tcp_schedule_loss_probe+0x410/0x550 net/ipv4/tcp_output.c:2791
       tcp_write_xmit+0x3d7e/0x64c0 net/ipv4/tcp_output.c:2740
       __tcp_push_pending_frames+0x97/0x350 net/ipv4/tcp_output.c:2894
       tcp_sendmsg_locked+0x37b2/0x4100 net/ipv4/tcp.c:1461
       tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1489
       sock_sendmsg_nosec net/socket.c:718 [inline]
       __sock_sendmsg net/socket.c:730 [inline]
       sock_write_iter+0x394/0x4e0 net/socket.c:1143
       call_write_iter include/linux/fs.h:2265 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x7ae/0xba0 fs/read_write.c:584
       ksys_write+0x19c/0x2c0 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  lock#10 --> &sighand->siglock --> &base->lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&base->lock);
                               lock(&sighand->siglock);
                               lock(&base->lock);
  lock(lock#10);

 *** DEADLOCK ***

4 locks held by syz-fuzzer/3544:
 #0: ffff8880202f8d70 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1748 [inline]
 #0: ffff8880202f8d70 (sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sendmsg+0x1e/0x40 net/ipv4/tcp.c:1488
 #1: ffff8880b9928358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999
 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #2: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: trace_call_bpf+0xbe/0x6a0 kernel/trace/bpf_trace.c:134
 #3: ffff888076196a58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #3: ffff888076196a58 (&mm->mmap_lock){++++}-{3:3}, at: stack_map_get_build_id_offset+0x232/0x9c0 kernel/bpf/stackmap.c:144

stack backtrace:
CPU: 1 PID: 3544 Comm: syz-fuzzer Not tainted 6.1.92-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3090 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 local_lock_acquire include/linux/local_lock_internal.h:29 [inline]
 __mmap_lock_do_trace_acquire_returned+0x9d/0x670 mm/mmap_lock.c:237
 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
 mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
 stack_map_get_build_id_offset+0x99e/0x9c0 kernel/bpf/stackmap.c:144
 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:452
 bpf_prog_e6cf5f9c69743609+0x3a/0x3e
 bpf_dispatcher_nop_func include/linux/bpf.h:989 [inline]
 __bpf_prog_run include/linux/filter.h:603 [inline]
 bpf_prog_run include/linux/filter.h:610 [inline]
 bpf_prog_run_array include/linux/bpf.h:1635 [inline]
 trace_call_bpf+0x345/0x6a0 kernel/trace/bpf_trace.c:135
 perf_trace_run_bpf_submit+0x7b/0x1d0 kernel/events/core.c:9924
 perf_trace_timer_class+0x2c8/0x380 include/trace/events/timer.h:12
 trace_timer_cancel include/trace/events/timer.h:138 [inline]
 debug_deactivate kernel/time/timer.c:832 [inline]
 detach_timer+0x2f4/0x380 kernel/time/timer.c:878
 detach_if_pending kernel/time/timer.c:899 [inline]
 __mod_timer+0x407/0xee0 kernel/time/timer.c:1076
 sk_reset_timer+0x1f/0xb0 net/core/sock.c:3371
 inet_csk_reset_xmit_timer include/net/inet_connection_sock.h:234 [inline]
 tcp_reset_xmit_timer include/net/tcp.h:1347 [inline]
 tcp_schedule_loss_probe+0x410/0x550 net/ipv4/tcp_output.c:2791
 tcp_write_xmit+0x3d7e/0x64c0 net/ipv4/tcp_output.c:2740
 __tcp_push_pending_frames+0x97/0x350 net/ipv4/tcp_output.c:2894
 tcp_sendmsg_locked+0x37b2/0x4100 net/ipv4/tcp.c:1461
 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1489
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 sock_write_iter+0x394/0x4e0 net/socket.c:1143
 call_write_iter include/linux/fs.h:2265 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x7ae/0xba0 fs/read_write.c:584
 ksys_write+0x19c/0x2c0 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x40720e
Code: 48 83 ec 38 e8 13 00 00 00 48 83 c4 38 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48
RSP: 002b:000000c0003e18c0 EFLAGS: 00000212 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000040720e
RDX: 0000000000000038 RSI: 000000c001357fc8 RDI: 0000000000000003
RBP: 000000c0003e1900 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 000000c0003e1a40
R13: 0000000000031fe8 R14: 000000c00048f6c0 R15: 000000c001326000
 </TASK>