FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
5.15.164-syzkaller #0 Not tainted
------------------------------------------------------
syz.2.2048/13382 is trying to acquire lock:
ffffffff8c7fc378 ((console_sem).lock){-.-.}-{2:2}, at: down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:138
but task is already holding lock:
ffff8880b9a3a358 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&rq->__lock){-.-.}-{2:2}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
_raw_spin_lock_nested+0x2d/0x40 kernel/locking/spinlock.c:368
raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475
raw_spin_rq_lock kernel/sched/sched.h:1326 [inline]
rq_lock kernel/sched/sched.h:1621 [inline]
task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11495
sched_cgroup_fork+0x2d3/0x330 kernel/sched/core.c:4466
copy_process+0x224a/0x3ef0 kernel/fork.c:2320
kernel_clone+0x210/0x960 kernel/fork.c:2604
kernel_thread+0x168/0x1e0 kernel/fork.c:2656
rest_init+0x21/0x330 init/main.c:706
start_kernel+0x48c/0x540 init/main.c:1140
secondary_startup_64_no_verify+0xb1/0xbb
-> #1 (&p->pi_lock){-.-.}-{2:2}:
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__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+0xae/0x1300 kernel/sched/core.c:4030
up+0x6e/0x90 kernel/locking/semaphore.c:190
__up_console_sem+0x11a/0x1e0 kernel/printk/printk.c:256
console_unlock+0x1145/0x12b0 kernel/printk/printk.c:2760
vprintk_emit+0xbf/0x150 kernel/printk/printk.c:2274
dev_vprintk_emit+0x2aa/0x330 drivers/base/core.c:4618
dev_printk_emit+0xd9/0x120 drivers/base/core.c:4629
_dev_warn+0x11e/0x170 drivers/base/core.c:4685
usb_set_configuration+0x1e3b/0x2020 drivers/usb/core/message.c:1980
usb_generic_driver_probe+0x84/0x140 drivers/usb/core/generic.c:238
usb_probe_device+0x130/0x260 drivers/usb/core/driver.c:293
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
__device_attach_driver+0x2b9/0x500 drivers/base/dd.c:907
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
__device_attach+0x359/0x570 drivers/base/dd.c:979
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487
device_add+0xb48/0xfd0 drivers/base/core.c:3412
usb_new_device+0xc17/0x18e0 drivers/usb/core/hub.c:2593
hub_port_connect drivers/usb/core/hub.c:5455 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5595 [inline]
port_event drivers/usb/core/hub.c:5741 [inline]
hub_event+0x2cdf/0x54c0 drivers/usb/core/hub.c:5823
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
-> #0 ((console_sem).lock){-.-.}-{2:2}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:138
__down_trylock_console_sem+0x105/0x250 kernel/printk/printk.c:239
console_trylock kernel/printk/printk.c:2575 [inline]
console_trylock_spinning+0x8a/0x3f0 kernel/printk/printk.c:1867
vprintk_emit+0xa6/0x150 kernel/printk/printk.c:2273
_printk+0xd1/0x120 kernel/printk/printk.c:2299
fail_dump lib/fault-inject.c:45 [inline]
should_fail+0x36c/0x4c0 lib/fault-inject.c:146
strncpy_from_user+0x32/0x370 lib/strncpy_from_user.c:118
strncpy_from_user_nofault+0x6c/0x130 mm/maccess.c:295
bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:194 [inline]
____bpf_probe_read_user_str kernel/trace/bpf_trace.c:203 [inline]
bpf_probe_read_user_str+0x26/0x70 kernel/trace/bpf_trace.c:200
bpf_prog_d944b8c152a67c20+0x64/0xbf0
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
context_switch kernel/sched/core.c:5016 [inline]
__schedule+0x1167/0x45b0 kernel/sched/core.c:6376
schedule+0x11b/0x1f0 kernel/sched/core.c:6459
schedule_timeout+0xac/0x300 kernel/time/timer.c:1890
do_wait_for_common+0x2d9/0x480 kernel/sched/completion.c:85
__wait_for_common kernel/sched/completion.c:106 [inline]
wait_for_common kernel/sched/completion.c:117 [inline]
wait_for_completion+0x48/0x60 kernel/sched/completion.c:138
__flush_work+0x124/0x1a0 kernel/workqueue.c:3094
n_tty_poll+0x2dd/0x790 drivers/tty/n_tty.c:2418
tty_poll+0x10a/0x1c0 drivers/tty/tty_io.c:2229
vfs_poll include/linux/poll.h:86 [inline]
do_pollfd fs/select.c:872 [inline]
do_poll fs/select.c:920 [inline]
do_sys_poll+0x77a/0x11f0 fs/select.c:1014
__do_sys_ppoll fs/select.c:1120 [inline]
__se_sys_ppoll+0x29c/0x330 fs/select.c:1100
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
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.2.2048/13382:
#0: ffff888077f67098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
#1: ffff8880b9a3a358 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475
#2: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
stack backtrace:
CPU: 0 PID: 13382 Comm: syz.2.2048 Not tainted 5.15.164-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/0x2d0 lib/dump_stack.c:106
check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
__lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:138
__down_trylock_console_sem+0x105/0x250 kernel/printk/printk.c:239
console_trylock kernel/printk/printk.c:2575 [inline]
console_trylock_spinning+0x8a/0x3f0 kernel/printk/printk.c:1867
vprintk_emit+0xa6/0x150 kernel/printk/printk.c:2273
_printk+0xd1/0x120 kernel/printk/printk.c:2299
fail_dump lib/fault-inject.c:45 [inline]
should_fail+0x36c/0x4c0 lib/fault-inject.c:146
strncpy_from_user+0x32/0x370 lib/strncpy_from_user.c:118
strncpy_from_user_nofault+0x6c/0x130 mm/maccess.c:295
bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:194 [inline]
____bpf_probe_read_user_str kernel/trace/bpf_trace.c:203 [inline]
bpf_probe_read_user_str+0x26/0x70 kernel/trace/bpf_trace.c:200
bpf_prog_d944b8c152a67c20+0x64/0xbf0
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
context_switch kernel/sched/core.c:5016 [inline]
__schedule+0x1167/0x45b0 kernel/sched/core.c:6376
schedule+0x11b/0x1f0 kernel/sched/core.c:6459
schedule_timeout+0xac/0x300 kernel/time/timer.c:1890
do_wait_for_common+0x2d9/0x480 kernel/sched/completion.c:85
__wait_for_common kernel/sched/completion.c:106 [inline]
wait_for_common kernel/sched/completion.c:117 [inline]
wait_for_completion+0x48/0x60 kernel/sched/completion.c:138
__flush_work+0x124/0x1a0 kernel/workqueue.c:3094
n_tty_poll+0x2dd/0x790 drivers/tty/n_tty.c:2418
tty_poll+0x10a/0x1c0 drivers/tty/tty_io.c:2229
vfs_poll include/linux/poll.h:86 [inline]
do_pollfd fs/select.c:872 [inline]
do_poll fs/select.c:920 [inline]
do_sys_poll+0x77a/0x11f0 fs/select.c:1014
__do_sys_ppoll fs/select.c:1120 [inline]
__se_sys_ppoll+0x29c/0x330 fs/select.c:1100
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fabfc3d49b9
Code: Unable to access opcode bytes at RIP 0x7fabfc3d498f.
RSP: 002b:00007fabfa830038 EFLAGS: 00000246 ORIG_RAX: 000000000000010f
RAX: ffffffffffffffda RBX: 00007fabfc571058 RCX: 00007fabfc3d49b9
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000020000140
RBP: 00007fabfa830090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 00007fabfc571058 R15: 00007ffed5b25188
CPU: 0 PID: 13382 Comm: syz.2.2048 Not tainted 5.15.164-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/0x2d0 lib/dump_stack.c:106
fail_dump lib/fault-inject.c:52 [inline]
should_fail+0x38a/0x4c0 lib/fault-inject.c:146
strncpy_from_user+0x32/0x370 lib/strncpy_from_user.c:118
strncpy_from_user_nofault+0x6c/0x130 mm/maccess.c:295
bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:194 [inline]
____bpf_probe_read_user_str kernel/trace/bpf_trace.c:203 [inline]
bpf_probe_read_user_str+0x26/0x70 kernel/trace/bpf_trace.c:200
bpf_prog_d944b8c152a67c20+0x64/0xbf0
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
context_switch kernel/sched/core.c:5016 [inline]
__schedule+0x1167/0x45b0 kernel/sched/core.c:6376
schedule+0x11b/0x1f0 kernel/sched/core.c:6459
schedule_timeout+0xac/0x300 kernel/time/timer.c:1890
do_wait_for_common+0x2d9/0x480 kernel/sched/completion.c:85
__wait_for_common kernel/sched/completion.c:106 [inline]
wait_for_common kernel/sched/completion.c:117 [inline]
wait_for_completion+0x48/0x60 kernel/sched/completion.c:138
__flush_work+0x124/0x1a0 kernel/workqueue.c:3094
n_tty_poll+0x2dd/0x790 drivers/tty/n_tty.c:2418
tty_poll+0x10a/0x1c0 drivers/tty/tty_io.c:2229
vfs_poll include/linux/poll.h:86 [inline]
do_pollfd fs/select.c:872 [inline]
do_poll fs/select.c:920 [inline]
do_sys_poll+0x77a/0x11f0 fs/select.c:1014
__do_sys_ppoll fs/select.c:1120 [inline]
__se_sys_ppoll+0x29c/0x330 fs/select.c:1100
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fabfc3d49b9
Code: Unable to access opcode bytes at RIP 0x7fabfc3d498f.
RSP: 002b:00007fabfa830038 EFLAGS: 00000246 ORIG_RAX: 000000000000010f
RAX: ffffffffffffffda RBX: 00007fabfc571058 RCX: 00007fabfc3d49b9
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000020000140
RBP: 00007fabfa830090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 00007fabfc571058 R15: 00007ffed5b25188