====================================================== WARNING: possible circular locking dependency detected 6.1.101-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.2425/11763 is trying to acquire lock: ffff888017754a18 (&sighand->siglock){-...}-{2:2}, at: __lock_task_sighand+0x145/0x2d0 kernel/signal.c:1410 but task is already holding lock: ffff8880b9935e90 (lock#11){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b9935e90 (lock#11){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (lock#11){+.+.}-{2:2}: 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_get_stack_raw_tp kernel/trace/bpf_trace.c:1877 [inline] bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1867 0xffffffffa0001f1a 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_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 trace_tlb_flush+0x151/0x1a0 include/trace/events/tlb.h:38 switch_mm_irqs_off+0x84a/0xc20 context_switch kernel/sched/core.c:5229 [inline] __schedule+0x1152/0x4570 kernel/sched/core.c:6561 preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6730 preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6754 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 __local_bh_enable_ip+0x175/0x1f0 kernel/softirq.c:403 spin_unlock_bh include/linux/spinlock.h:396 [inline] __ip6_ins_rt net/ipv6/route.c:1309 [inline] ip6_route_add+0x8f/0x120 net/ipv6/route.c:3852 addrconf_add_mroute net/ipv6/addrconf.c:2506 [inline] addrconf_add_dev+0x350/0x500 net/ipv6/addrconf.c:2524 addrconf_dev_config net/ipv6/addrconf.c:3408 [inline] addrconf_init_auto_addrs+0x88e/0xe60 net/ipv6/addrconf.c:3495 addrconf_notify+0xade/0xf60 net/ipv6/addrconf.c:3668 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455 __dev_notify_flags+0x304/0x610 dev_change_flags+0xe7/0x190 net/core/dev.c:8661 do_setlink+0xcf4/0x3de0 net/core/rtnetlink.c:2801 __rtnl_newlink net/core/rtnetlink.c:3576 [inline] rtnl_newlink+0x172c/0x2050 net/core/rtnetlink.c:3623 rtnetlink_rcv_msg+0x818/0xff0 net/core/rtnetlink.c:6121 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2508 netlink_unicast_kernel net/netlink/af_netlink.c:1326 [inline] netlink_unicast+0x7d8/0x970 net/netlink/af_netlink.c:1352 netlink_sendmsg+0xa26/0xd60 net/netlink/af_netlink.c:1874 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] __sys_sendto+0x480/0x600 net/socket.c:2148 __do_sys_sendto net/socket.c:2160 [inline] __se_sys_sendto net/socket.c:2156 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2156 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 -> #2 (&rq->__lock){-.-.}-{2:2}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 _raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:378 raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537 raw_spin_rq_lock kernel/sched/sched.h:1355 [inline] rq_lock kernel/sched/sched.h:1645 [inline] task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11878 sched_cgroup_fork+0x374/0x400 kernel/sched/core.c:4685 copy_process+0x2442/0x4060 kernel/fork.c:2384 kernel_clone+0x222/0x920 kernel/fork.c:2682 user_mode_thread+0x12e/0x190 kernel/fork.c:2758 rest_init+0x23/0x300 init/main.c:698 start_kernel+0x0/0x53f init/main.c:893 start_kernel+0x496/0x53f init/main.c:1140 secondary_startup_64_no_verify+0xcf/0xdb -> #1 (&p->pi_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 try_to_wake_up+0xad/0x12e0 kernel/sched/core.c:4111 signal_wake_up_state kernel/signal.c:780 [inline] signal_wake_up include/linux/sched/signal.h:457 [inline] complete_signal+0x796/0xbd0 kernel/signal.c:1074 __send_signal_locked+0xb1a/0xdc0 kernel/signal.c:1194 do_notify_parent+0xe2b/0x1100 kernel/signal.c:2120 exit_notify kernel/exit.c:746 [inline] do_exit+0x172e/0x26a0 kernel/exit.c:891 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030 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 -> #0 (&sighand->siglock){-...}-{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 __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:1312 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x169/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 copy_user_short_string+0xa/0x40 arch/x86/lib/copy_user_64.S:231 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline] _copy_from_user+0xf3/0x170 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:161 [inline] copy_msghdr_from_user+0xaa/0x670 net/socket.c:2444 recvmsg_copy_msghdr net/socket.c:2699 [inline] ___sys_recvmsg net/socket.c:2771 [inline] do_recvmmsg+0x408/0xad0 net/socket.c:2869 __sys_recvmmsg net/socket.c:2948 [inline] __do_sys_recvmmsg net/socket.c:2971 [inline] __se_sys_recvmmsg net/socket.c:2964 [inline] __x64_sys_recvmmsg+0x195/0x240 net/socket.c:2964 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: &sighand->siglock --> &rq->__lock --> lock#11 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(lock#11); lock(&rq->__lock); lock(lock#11); lock(&sighand->siglock); *** DEADLOCK *** 5 locks held by syz.1.2425/11763: #0: ffff88801286f1d8 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88801286f1d8 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5304 [inline] #0: ffff88801286f1d8 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2e0 mm/memory.c:5366 #1: ffff8880b9935e90 (lock#11){+.+.}-{2:2}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] #1: ffff8880b9935e90 (lock#11){+.+.}-{2:2}, at: __mmap_lock_do_trace_acquire_returned+0x84/0x670 mm/mmap_lock.c:237 #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: get_memcg_path_buf mm/mmap_lock.c:139 [inline] #2: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: get_mm_memcg_path+0xb1/0x600 mm/mmap_lock.c:209 #3: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #3: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2314 #4: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #4: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #4: ffffffff8d32ad40 (rcu_read_lock){....}-{1:2}, at: __lock_task_sighand+0x25/0x2d0 kernel/signal.c:1393 stack backtrace: CPU: 1 PID: 11763 Comm: syz.1.2425 Not tainted 6.1.101-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __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 __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:1312 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x169/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:copy_user_short_string+0xa/0x40 arch/x86/lib/copy_user_64.S:232 Code: 83 f8 12 74 0a 89 d1 f3 a4 89 c8 0f 01 ca c3 89 d0 0f 01 ca c3 01 ca eb e7 0f 1f 80 00 00 00 00 89 d1 83 e2 07 c1 e9 03 74 12 <4c> 8b 06 4c 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 RSP: 0018:ffffc90003f1f950 EFLAGS: 00050202 RAX: ffffffff8438a701 RBX: 00007fffffffefc8 RCX: 0000000000000007 RDX: 0000000000000000 RSI: 0000000020129000 RDI: ffffc90003f1f9e0 RBP: ffffc90003f1fa90 R08: dffffc0000000000 R09: fffff520007e3f43 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000038 R13: dffffc0000000000 R14: ffffc90003f1f9e0 R15: 0000000020129000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline] _copy_from_user+0xf3/0x170 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:161 [inline] copy_msghdr_from_user+0xaa/0x670 net/socket.c:2444 recvmsg_copy_msghdr net/socket.c:2699 [inline] ___sys_recvmsg net/socket.c:2771 [inline] do_recvmmsg+0x408/0xad0 net/socket.c:2869 __sys_recvmmsg net/socket.c:2948 [inline] __do_sys_recvmmsg net/socket.c:2971 [inline] __se_sys_recvmmsg net/socket.c:2964 [inline] __x64_sys_recvmmsg+0x195/0x240 net/socket.c:2964 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:0x7f901a977299 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f901b730048 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00007f901ab06058 RCX: 00007f901a977299 RDX: 0000000000010106 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007f901a9e48e6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f901ab06058 R15: 00007ffd6b621078 ---------------- Code disassembly (best guess): 0: 83 f8 12 cmp $0x12,%eax 3: 74 0a je 0xf 5: 89 d1 mov %edx,%ecx 7: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 9: 89 c8 mov %ecx,%eax b: 0f 01 ca clac e: c3 ret f: 89 d0 mov %edx,%eax 11: 0f 01 ca clac 14: c3 ret 15: 01 ca add %ecx,%edx 17: eb e7 jmp 0x0 19: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) 20: 89 d1 mov %edx,%ecx 22: 83 e2 07 and $0x7,%edx 25: c1 e9 03 shr $0x3,%ecx 28: 74 12 je 0x3c * 2a: 4c 8b 06 mov (%rsi),%r8 <-- trapping instruction 2d: 4c 89 07 mov %r8,(%rdi) 30: 48 8d 76 08 lea 0x8(%rsi),%rsi 34: 48 8d 7f 08 lea 0x8(%rdi),%rdi 38: ff c9 dec %ecx 3a: 75 ee jne 0x2a 3c: 21 d2 and %edx,%edx 3e: 74 10 je 0x50