FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
6.13.0-rc6-syzkaller-00036-gfbfd64d25c7a #0 Not tainted
------------------------------------------------------
syz.0.549/8756 is trying to acquire lock:
ffffffff8e1a94b8 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x12/0x70 kernel/locking/semaphore.c:139

but task is already holding lock:
ffff8880b863ed18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:598

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&rq->__lock){-.-.}-{2:2}:
       _raw_spin_lock_nested+0x31/0x40 kernel/locking/spinlock.c:378
       raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:598
       raw_spin_rq_lock kernel/sched/sched.h:1523 [inline]
       task_rq_lock+0xcf/0x3b0 kernel/sched/core.c:700
       cgroup_move_task+0x82/0x250 kernel/sched/psi.c:1161
       css_set_move_task+0x288/0x5f0 kernel/cgroup/cgroup.c:898
       cgroup_post_fork+0x1c6/0x910 kernel/cgroup/cgroup.c:6691
       copy_process+0x50d8/0x8e50 kernel/fork.c:2620
       kernel_clone+0xfd/0x960 kernel/fork.c:2806
       user_mode_thread+0xb4/0xf0 kernel/fork.c:2884
       rest_init+0x23/0x2b0 init/main.c:712
       start_kernel+0x3e4/0x4d0 init/main.c:1102
       x86_64_start_reservations+0x18/0x30 arch/x86/kernel/head64.c:507
       x86_64_start_kernel+0xb2/0xc0 arch/x86/kernel/head64.c:488
       common_startup_64+0x13e/0x148

-> #1 (&p->pi_lock){-.-.}-{2:2}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
       class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline]
       try_to_wake_up+0xb6/0x1490 kernel/sched/core.c:4205
       up+0x79/0xb0 kernel/locking/semaphore.c:191
       __up_console_sem+0x85/0xe0 kernel/printk/printk.c:343
       __console_unlock kernel/printk/printk.c:2869 [inline]
       __console_flush_and_unlock kernel/printk/printk.c:3271 [inline]
       console_unlock+0x1dc/0x210 kernel/printk/printk.c:3309
       vprintk_emit+0x424/0x6f0 kernel/printk/printk.c:2432
       vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:86
       _printk+0xc8/0x100 kernel/printk/printk.c:2457
       p9_fd_create+0x40f/0x490 net/9p/trans_fd.c:1098
       p9_client_create+0x839/0x1200 net/9p/client.c:1017
       v9fs_session_init+0x1f8/0x1a80 fs/9p/v9fs.c:410
       v9fs_mount+0xc6/0xa30 fs/9p/vfs_super.c:122
       legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
       vfs_get_tree+0x92/0x380 fs/super.c:1814
       do_new_mount fs/namespace.c:3513 [inline]
       path_mount+0x14e6/0x1f10 fs/namespace.c:3840
       do_mount fs/namespace.c:3853 [inline]
       __do_sys_mount fs/namespace.c:4063 [inline]
       __se_sys_mount fs/namespace.c:4040 [inline]
       __x64_sys_mount+0x294/0x320 fs/namespace.c:4040
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 ((console_sem).lock){-.-.}-{2:2}:
       check_prev_add kernel/locking/lockdep.c:3161 [inline]
       check_prevs_add kernel/locking/lockdep.c:3280 [inline]
       validate_chain kernel/locking/lockdep.c:3904 [inline]
       __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226
       lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
       down_trylock+0x12/0x70 kernel/locking/semaphore.c:139
       __down_trylock_console_sem+0x40/0x140 kernel/printk/printk.c:326
       console_trylock kernel/printk/printk.c:2852 [inline]
       console_trylock_spinning kernel/printk/printk.c:2009 [inline]
       vprintk_emit+0x3ec/0x6f0 kernel/printk/printk.c:2431
       vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:86
       _printk+0xc8/0x100 kernel/printk/printk.c:2457
       fail_dump lib/fault-inject.c:46 [inline]
       should_fail_ex+0x46c/0x5b0 lib/fault-inject.c:154
       strncpy_from_user+0x3b/0x2d0 lib/strncpy_from_user.c:118
       strncpy_from_user_nofault+0x7f/0x180 mm/maccess.c:193
       bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:215 [inline]
       ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:310 [inline]
       bpf_probe_read_compat_str+0xf1/0x170 kernel/trace/bpf_trace.c:306
       bpf_prog_c1796171ffc7efef+0x3e/0x44
       bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline]
       __bpf_prog_run include/linux/filter.h:701 [inline]
       bpf_prog_run include/linux/filter.h:708 [inline]
       __bpf_trace_run kernel/trace/bpf_trace.c:2362 [inline]
       bpf_trace_run4+0x248/0x5a0 kernel/trace/bpf_trace.c:2405
       __bpf_trace_sched_switch+0x13e/0x190 include/trace/events/sched.h:222
       __traceiter_sched_switch+0x6f/0xc0 include/trace/events/sched.h:222
       trace_sched_switch include/trace/events/sched.h:222 [inline]
       __schedule+0x1b71/0x5ad0 kernel/sched/core.c:6753
       preempt_schedule_common+0x44/0xc0 kernel/sched/core.c:6935
       preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12
       __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
       _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:194
       __debug_check_no_obj_freed lib/debugobjects.c:1108 [inline]
       debug_check_no_obj_freed+0x327/0x600 lib/debugobjects.c:1129
       free_pages_prepare mm/page_alloc.c:1134 [inline]
       free_unref_page+0x276/0x1080 mm/page_alloc.c:2659
       __put_partials+0x14c/0x170 mm/slub.c:3157
       qlink_free mm/kasan/quarantine.c:163 [inline]
       qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179
       kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
       __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329
       kasan_slab_alloc include/linux/kasan.h:250 [inline]
       slab_post_alloc_hook mm/slub.c:4119 [inline]
       slab_alloc_node mm/slub.c:4168 [inline]
       kmem_cache_alloc_node_noprof+0x223/0x3c0 mm/slub.c:4220
       __alloc_skb+0x2b1/0x380 net/core/skbuff.c:668
       alloc_skb include/linux/skbuff.h:1323 [inline]
       netlink_alloc_large_skb+0x69/0x130 net/netlink/af_netlink.c:1196
       netlink_sendmsg+0x689/0xd70 net/netlink/af_netlink.c:1866
       sock_sendmsg_nosec net/socket.c:711 [inline]
       __sock_sendmsg net/socket.c:726 [inline]
       ____sys_sendmsg+0xab2/0xc90 net/socket.c:2583
       ___sys_sendmsg+0x135/0x1e0 net/socket.c:2637
       __sys_sendmsg+0x16e/0x220 net/socket.c:2669
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

Chain exists of:
  (console_sem).lock --> &p->pi_lock --> &rq->__lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&rq->__lock);
                               lock(&p->pi_lock);
                               lock(&rq->__lock);
  lock((console_sem).lock);

 *** DEADLOCK ***

3 locks held by syz.0.549/8756:
 #0: ffffffff8e37b1d0 (remove_cache_srcu){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:158 [inline]
 #0: ffffffff8e37b1d0 (remove_cache_srcu){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:249 [inline]
 #0: ffffffff8e37b1d0 (remove_cache_srcu){.+.+}-{0:0}, at: kasan_quarantine_reduce+0x88/0x1e0 mm/kasan/quarantine.c:259
 #1: ffff8880b863ed18 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x29/0x130 kernel/sched/core.c:598
 #2: ffffffff8e1bb900 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #2: ffffffff8e1bb900 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #2: ffffffff8e1bb900 (rcu_read_lock){....}-{1:3}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2361 [inline]
 #2: ffffffff8e1bb900 (rcu_read_lock){....}-{1:3}, at: bpf_trace_run4+0x1d6/0x5a0 kernel/trace/bpf_trace.c:2405

stack backtrace:
CPU: 0 UID: 0 PID: 8756 Comm: syz.0.549 Not tainted 6.13.0-rc6-syzkaller-00036-gfbfd64d25c7a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_circular_bug+0x419/0x5d0 kernel/locking/lockdep.c:2074
 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206
 check_prev_add kernel/locking/lockdep.c:3161 [inline]
 check_prevs_add kernel/locking/lockdep.c:3280 [inline]
 validate_chain kernel/locking/lockdep.c:3904 [inline]
 __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226
 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
 down_trylock+0x12/0x70 kernel/locking/semaphore.c:139
 __down_trylock_console_sem+0x40/0x140 kernel/printk/printk.c:326
 console_trylock kernel/printk/printk.c:2852 [inline]
 console_trylock_spinning kernel/printk/printk.c:2009 [inline]
 vprintk_emit+0x3ec/0x6f0 kernel/printk/printk.c:2431
 vprintk+0x7f/0xa0 kernel/printk/printk_safe.c:86
 _printk+0xc8/0x100 kernel/printk/printk.c:2457
 fail_dump lib/fault-inject.c:46 [inline]
 should_fail_ex+0x46c/0x5b0 lib/fault-inject.c:154
 strncpy_from_user+0x3b/0x2d0 lib/strncpy_from_user.c:118
 strncpy_from_user_nofault+0x7f/0x180 mm/maccess.c:193
 bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:215 [inline]
 ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:310 [inline]
 bpf_probe_read_compat_str+0xf1/0x170 kernel/trace/bpf_trace.c:306
 bpf_prog_c1796171ffc7efef+0x3e/0x44
 bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2362 [inline]
 bpf_trace_run4+0x248/0x5a0 kernel/trace/bpf_trace.c:2405
 __bpf_trace_sched_switch+0x13e/0x190 include/trace/events/sched.h:222
 __traceiter_sched_switch+0x6f/0xc0 include/trace/events/sched.h:222
 trace_sched_switch include/trace/events/sched.h:222 [inline]
 __schedule+0x1b71/0x5ad0 kernel/sched/core.c:6753
 preempt_schedule_common+0x44/0xc0 kernel/sched/core.c:6935
 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
 _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:194
 __debug_check_no_obj_freed lib/debugobjects.c:1108 [inline]
 debug_check_no_obj_freed+0x327/0x600 lib/debugobjects.c:1129
 free_pages_prepare mm/page_alloc.c:1134 [inline]
 free_unref_page+0x276/0x1080 mm/page_alloc.c:2659
 __put_partials+0x14c/0x170 mm/slub.c:3157
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4119 [inline]
 slab_alloc_node mm/slub.c:4168 [inline]
 kmem_cache_alloc_node_noprof+0x223/0x3c0 mm/slub.c:4220
 __alloc_skb+0x2b1/0x380 net/core/skbuff.c:668
 alloc_skb include/linux/skbuff.h:1323 [inline]
 netlink_alloc_large_skb+0x69/0x130 net/netlink/af_netlink.c:1196
 netlink_sendmsg+0x689/0xd70 net/netlink/af_netlink.c:1866
 sock_sendmsg_nosec net/socket.c:711 [inline]
 __sock_sendmsg net/socket.c:726 [inline]
 ____sys_sendmsg+0xab2/0xc90 net/socket.c:2583
 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2637
 __sys_sendmsg+0x16e/0x220 net/socket.c:2669
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdbd0985d29
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:00007fdbd17e1038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fdbd0b75fa0 RCX: 00007fdbd0985d29
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007fdbd17e1090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 00007fdbd0b75fa0 R15: 00007ffea3d51348
 </TASK>
CPU: 0 UID: 0 PID: 8756 Comm: syz.0.549 Not tainted 6.13.0-rc6-syzkaller-00036-gfbfd64d25c7a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 fail_dump lib/fault-inject.c:53 [inline]
 should_fail_ex+0x497/0x5b0 lib/fault-inject.c:154
 strncpy_from_user+0x3b/0x2d0 lib/strncpy_from_user.c:118
 strncpy_from_user_nofault+0x7f/0x180 mm/maccess.c:193
 bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:215 [inline]
 ____bpf_probe_read_compat_str kernel/trace/bpf_trace.c:310 [inline]
 bpf_probe_read_compat_str+0xf1/0x170 kernel/trace/bpf_trace.c:306
 bpf_prog_c1796171ffc7efef+0x3e/0x44
 bpf_dispatcher_nop_func include/linux/bpf.h:1290 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2362 [inline]
 bpf_trace_run4+0x248/0x5a0 kernel/trace/bpf_trace.c:2405
 __bpf_trace_sched_switch+0x13e/0x190 include/trace/events/sched.h:222
 __traceiter_sched_switch+0x6f/0xc0 include/trace/events/sched.h:222
 trace_sched_switch include/trace/events/sched.h:222 [inline]
 __schedule+0x1b71/0x5ad0 kernel/sched/core.c:6753
 preempt_schedule_common+0x44/0xc0 kernel/sched/core.c:6935
 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12
 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
 _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:194
 __debug_check_no_obj_freed lib/debugobjects.c:1108 [inline]
 debug_check_no_obj_freed+0x327/0x600 lib/debugobjects.c:1129
 free_pages_prepare mm/page_alloc.c:1134 [inline]
 free_unref_page+0x276/0x1080 mm/page_alloc.c:2659
 __put_partials+0x14c/0x170 mm/slub.c:3157
 qlink_free mm/kasan/quarantine.c:163 [inline]
 qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179
 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286
 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:329
 kasan_slab_alloc include/linux/kasan.h:250 [inline]
 slab_post_alloc_hook mm/slub.c:4119 [inline]
 slab_alloc_node mm/slub.c:4168 [inline]
 kmem_cache_alloc_node_noprof+0x223/0x3c0 mm/slub.c:4220
 __alloc_skb+0x2b1/0x380 net/core/skbuff.c:668
 alloc_skb include/linux/skbuff.h:1323 [inline]
 netlink_alloc_large_skb+0x69/0x130 net/netlink/af_netlink.c:1196
 netlink_sendmsg+0x689/0xd70 net/netlink/af_netlink.c:1866
 sock_sendmsg_nosec net/socket.c:711 [inline]
 __sock_sendmsg net/socket.c:726 [inline]
 ____sys_sendmsg+0xab2/0xc90 net/socket.c:2583
 ___sys_sendmsg+0x135/0x1e0 net/socket.c:2637
 __sys_sendmsg+0x16e/0x220 net/socket.c:2669
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdbd0985d29
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:00007fdbd17e1038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fdbd0b75fa0 RCX: 00007fdbd0985d29
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007fdbd17e1090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 00007fdbd0b75fa0 R15: 00007ffea3d51348
 </TASK>