======================================================== WARNING: possible irq lock inversion dependency detected 6.7.0-rc1-next-20231117-syzkaller #0 Not tainted -------------------------------------------------------- kworker/u4:9/2442 just changed the state of lock: ffffffff8cff86b8 (css_set_lock){..-.}-{2:2}, at: put_css_set kernel/cgroup/cgroup-internal.h:208 [inline] ffffffff8cff86b8 (css_set_lock){..-.}-{2:2}, at: put_css_set kernel/cgroup/cgroup-internal.h:196 [inline] ffffffff8cff86b8 (css_set_lock){..-.}-{2:2}, at: cgroup_free+0x7c/0x1d0 kernel/cgroup/cgroup.c:6748 but this lock took another, SOFTIRQ-unsafe lock in the past: (&sighand->siglock){+.+.}-{2:2} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sighand->siglock); local_irq_disable(); lock(css_set_lock); lock(&sighand->siglock); lock(css_set_lock); *** DEADLOCK *** 5 locks held by kworker/u4:9/2442: #0: ffff88814c3c3d38 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work+0x78c/0x15f0 kernel/workqueue.c:2611 #1: ffffc9000a9e7d80 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_one_work+0x7f6/0x15f0 kernel/workqueue.c:2612 #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline] #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline] #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] #2: ffffffff8cfad060 (rcu_read_lock){....}-{1:2}, at: batadv_nc_worker+0x168/0x10e0 net/batman-adv/network-coding.c:719 #3: ffffffff8cfacf40 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline] #3: ffffffff8cfacf40 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2152 [inline] #3: ffffffff8cfacf40 (rcu_callback){....}-{0:0}, at: rcu_core+0x7cc/0x16b0 kernel/rcu/tree.c:2431 #4: ffffffff8ce58800 (put_task_map-wait-type-override){+...}-{3:3}, at: put_task_struct include/linux/sched/task.h:135 [inline] #4: ffffffff8ce58800 (put_task_map-wait-type-override){+...}-{3:3}, at: put_task_struct include/linux/sched/task.h:123 [inline] #4: ffffffff8ce58800 (put_task_map-wait-type-override){+...}-{3:3}, at: delayed_put_task_struct+0x21e/0x2d0 kernel/exit.c:227 the shortest dependencies between 2nd lock and 1st lock: -> (&sighand->siglock){+.+.}-{2:2} { HARDIRQ-ON-W at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:530 [inline] ptrace_set_stopped kernel/ptrace.c:391 [inline] ptrace_attach+0x401/0x650 kernel/ptrace.c:478 __do_sys_ptrace+0x204/0x230 kernel/ptrace.c:1290 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a SOFTIRQ-ON-W at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] class_spinlock_constructor include/linux/spinlock.h:530 [inline] ptrace_set_stopped kernel/ptrace.c:391 [inline] ptrace_attach+0x401/0x650 kernel/ptrace.c:478 __do_sys_ptrace+0x204/0x230 kernel/ptrace.c:1290 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x36/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] calculate_sigpending+0x44/0xa0 kernel/signal.c:197 ret_from_fork+0x23/0x80 arch/x86/kernel/process.c:143 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 } ... key at: [] __key.341+0x0/0x40 ... acquired at: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 __lock_task_sighand+0xc2/0x340 kernel/signal.c:1422 lock_task_sighand include/linux/sched/signal.h:748 [inline] cgroup_freeze_task+0x80/0x190 kernel/cgroup/freezer.c:160 cgroup_freezer_migrate_task+0x1b7/0x3a0 kernel/cgroup/freezer.c:257 cgroup_migrate_execute+0x2d3/0x1230 kernel/cgroup/cgroup.c:2580 cgroup_update_dfl_csses+0x51b/0x640 kernel/cgroup/cgroup.c:3068 cgroup_apply_control kernel/cgroup/cgroup.c:3308 [inline] cgroup_subtree_control_write+0xb94/0xed0 kernel/cgroup/cgroup.c:3453 cgroup_file_write+0x209/0x7c0 kernel/cgroup/cgroup.c:4092 kernfs_fop_write_iter+0x33f/0x500 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x64d/0xdf0 fs/read_write.c:584 ksys_write+0x12f/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x62/0x6a -> (css_set_lock){..-.}-{2:2} { IN-SOFTIRQ-W at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 put_css_set kernel/cgroup/cgroup-internal.h:208 [inline] put_css_set kernel/cgroup/cgroup-internal.h:196 [inline] cgroup_free+0x7c/0x1d0 kernel/cgroup/cgroup.c:6748 __put_task_struct+0x10b/0x3d0 kernel/fork.c:992 put_task_struct include/linux/sched/task.h:136 [inline] put_task_struct include/linux/sched/task.h:123 [inline] delayed_put_task_struct+0x22c/0x2d0 kernel/exit.c:227 rcu_do_batch kernel/rcu/tree.c:2158 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2431 __do_softirq+0x216/0x8d5 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 check_preemption_disabled+0x21/0xe0 lib/smp_processor_id.c:56 rcu_dynticks_curr_cpu_in_eqs include/linux/context_tracking.h:122 [inline] rcu_is_watching+0x12/0xb0 kernel/rcu/tree.c:700 rcu_read_lock include/linux/rcupdate.h:748 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] batadv_nc_worker+0xc89/0x10e0 net/batman-adv/network-coding.c:719 process_one_work+0x8a4/0x15f0 kernel/workqueue.c:2636 process_scheduled_works kernel/workqueue.c:2709 [inline] worker_thread+0x8b6/0x1290 kernel/workqueue.c:2790 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x36/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:376 [inline] cgroup_setup_root+0x62c/0xa00 kernel/cgroup/cgroup.c:2138 cgroup_init+0x23f/0x1100 kernel/cgroup/cgroup.c:6120 start_kernel+0x385/0x480 init/main.c:1063 x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:555 x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:536 secondary_startup_64_no_verify+0x166/0x16b } ... key at: [] css_set_lock+0x18/0x60 ... acquired at: mark_usage kernel/locking/lockdep.c:4566 [inline] __lock_acquire+0x13c2/0x3b10 kernel/locking/lockdep.c:5090 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 put_css_set kernel/cgroup/cgroup-internal.h:208 [inline] put_css_set kernel/cgroup/cgroup-internal.h:196 [inline] cgroup_free+0x7c/0x1d0 kernel/cgroup/cgroup.c:6748 __put_task_struct+0x10b/0x3d0 kernel/fork.c:992 put_task_struct include/linux/sched/task.h:136 [inline] put_task_struct include/linux/sched/task.h:123 [inline] delayed_put_task_struct+0x22c/0x2d0 kernel/exit.c:227 rcu_do_batch kernel/rcu/tree.c:2158 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2431 __do_softirq+0x216/0x8d5 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 check_preemption_disabled+0x21/0xe0 lib/smp_processor_id.c:56 rcu_dynticks_curr_cpu_in_eqs include/linux/context_tracking.h:122 [inline] rcu_is_watching+0x12/0xb0 kernel/rcu/tree.c:700 rcu_read_lock include/linux/rcupdate.h:748 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] batadv_nc_worker+0xc89/0x10e0 net/batman-adv/network-coding.c:719 process_one_work+0x8a4/0x15f0 kernel/workqueue.c:2636 process_scheduled_works kernel/workqueue.c:2709 [inline] worker_thread+0x8b6/0x1290 kernel/workqueue.c:2790 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 stack backtrace: CPU: 0 PID: 2442 Comm: kworker/u4:9 Not tainted 6.7.0-rc1-next-20231117-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Workqueue: bat_events batadv_nc_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_irq_inversion_bug.part.0+0x3e1/0x590 kernel/locking/lockdep.c:4079 print_irq_inversion_bug kernel/locking/lockdep.c:4032 [inline] check_usage_forwards kernel/locking/lockdep.c:4110 [inline] mark_lock_irq kernel/locking/lockdep.c:4242 [inline] mark_lock+0x570/0xc50 kernel/locking/lockdep.c:4677 mark_usage kernel/locking/lockdep.c:4566 [inline] __lock_acquire+0x13c2/0x3b10 kernel/locking/lockdep.c:5090 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1b1/0x530 kernel/locking/lockdep.c:5718 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x50 kernel/locking/spinlock.c:162 put_css_set kernel/cgroup/cgroup-internal.h:208 [inline] put_css_set kernel/cgroup/cgroup-internal.h:196 [inline] cgroup_free+0x7c/0x1d0 kernel/cgroup/cgroup.c:6748 __put_task_struct+0x10b/0x3d0 kernel/fork.c:992 put_task_struct include/linux/sched/task.h:136 [inline] put_task_struct include/linux/sched/task.h:123 [inline] delayed_put_task_struct+0x22c/0x2d0 kernel/exit.c:227 rcu_do_batch kernel/rcu/tree.c:2158 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2431 __do_softirq+0x216/0x8d5 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0xb5/0x120 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x95/0xb0 arch/x86/kernel/apic/apic.c:1076 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:check_preemption_disabled+0x21/0xe0 lib/smp_processor_id.c:56 Code: 90 e9 83 fc ff ff 0f 1f 00 41 54 55 53 48 83 ec 08 65 8b 1d 1d 9d 82 75 65 8b 05 12 9d 82 75 a9 ff ff ff 7f 74 0b 48 83 c4 08 <89> d8 5b 5d 41 5c c3 9c 58 f6 c4 02 74 ee 65 48 8b 05 e9 9c 82 75 RSP: 0018:ffffc9000a9e7b70 EFLAGS: 00000292 RAX: 0000000080000001 RBX: 0000000000000000 RCX: ffffffff8a493b6f RDX: ffff888025d18000 RSI: ffffffff8b2f14a0 RDI: ffffffff8b2f14e0 RBP: 00000000000003ca R08: 0000000000000005 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000002 R12: ffff888142f5a7c0 R13: 0000000000000000 R14: dffffc0000000000 R15: 0000000000000001 rcu_dynticks_curr_cpu_in_eqs include/linux/context_tracking.h:122 [inline] rcu_is_watching+0x12/0xb0 kernel/rcu/tree.c:700 rcu_read_lock include/linux/rcupdate.h:748 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] batadv_nc_worker+0xc89/0x10e0 net/batman-adv/network-coding.c:719 process_one_work+0x8a4/0x15f0 kernel/workqueue.c:2636 process_scheduled_works kernel/workqueue.c:2709 [inline] worker_thread+0x8b6/0x1290 kernel/workqueue.c:2790 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 ---------------- Code disassembly (best guess): 0: 90 nop 1: e9 83 fc ff ff jmp 0xfffffc89 6: 0f 1f 00 nopl (%rax) 9: 41 54 push %r12 b: 55 push %rbp c: 53 push %rbx d: 48 83 ec 08 sub $0x8,%rsp 11: 65 8b 1d 1d 9d 82 75 mov %gs:0x75829d1d(%rip),%ebx # 0x75829d35 18: 65 8b 05 12 9d 82 75 mov %gs:0x75829d12(%rip),%eax # 0x75829d31 1f: a9 ff ff ff 7f test $0x7fffffff,%eax 24: 74 0b je 0x31 26: 48 83 c4 08 add $0x8,%rsp * 2a: 89 d8 mov %ebx,%eax <-- trapping instruction 2c: 5b pop %rbx 2d: 5d pop %rbp 2e: 41 5c pop %r12 30: c3 ret 31: 9c pushf 32: 58 pop %rax 33: f6 c4 02 test $0x2,%ah 36: 74 ee je 0x26 38: 65 48 8b 05 e9 9c 82 mov %gs:0x75829ce9(%rip),%rax # 0x75829d29 3f: 75