FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
5.15.173-syzkaller #0 Not tainted
------------------------------------------------------
syz.1.42/5240 is trying to acquire lock:
ffffffff8c9147e0 (console_owner){....}-{0:0}, at: console_lock_spinning_enable+0x2c/0x60 kernel/printk/printk.c:1802
but task is already holding lock:
ffff8880b903a318 (&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:
-> #4 (&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:11484
sched_cgroup_fork+0x2d3/0x330 kernel/sched/core.c:4463
copy_process+0x224a/0x3ef0 kernel/fork.c:2319
kernel_clone+0x210/0x960 kernel/fork.c:2603
kernel_thread+0x168/0x1e0 kernel/fork.c:2655
rest_init+0x21/0x330 init/main.c:706
start_kernel+0x48c/0x540 init/main.c:1140
secondary_startup_64_no_verify+0xb1/0xbb
-> #3 (&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:4027
__wake_up_common+0x2a0/0x4e0 kernel/sched/wait.c:108
__wake_up_common_lock kernel/sched/wait.c:138 [inline]
__wake_up+0x112/0x1c0 kernel/sched/wait.c:157
tty_port_default_wakeup+0xa8/0x100 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1828
serial8250_handle_irq+0x505/0x600 drivers/tty/serial/8250/8250_port.c:1924
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x292/0xa70 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0xae/0xd0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
lockdep_enabled kernel/locking/lockdep.c:88 [inline]
lock_acquire+0x111/0x4f0 kernel/locking/lockdep.c:5599
__fs_reclaim_acquire mm/page_alloc.c:4580 [inline]
fs_reclaim_acquire+0x83/0x120 mm/page_alloc.c:4594
prepare_alloc_pages+0x147/0x5b0 mm/page_alloc.c:5236
__alloc_pages+0x14f/0x700 mm/page_alloc.c:5453
alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146
do_anonymous_page mm/memory.c:3836 [inline]
handle_pte_fault mm/memory.c:4646 [inline]
__handle_mm_fault mm/memory.c:4783 [inline]
handle_mm_fault+0x2f49/0x5960 mm/memory.c:4881
do_user_addr_fault arch/x86/mm/fault.c:1357 [inline]
handle_page_fault arch/x86/mm/fault.c:1445 [inline]
exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
copy_user_generic_unrolled+0xa0/0xc0 arch/x86/lib/copy_user_64.S:100
copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline]
raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline]
_copy_to_user+0xef/0x130 lib/usercopy.c:40
copy_to_user include/linux/uaccess.h:200 [inline]
create_elf_tables+0x1bd/0x12c0 fs/binfmt_elf.c:213
load_elf_binary+0x1e54/0x2750 fs/binfmt_elf.c:1269
search_binary_handler fs/exec.c:1742 [inline]
exec_binprm fs/exec.c:1783 [inline]
bprm_execve+0x8fd/0x17c0 fs/exec.c:1852
do_execveat_common+0x583/0x720 fs/exec.c:1957
do_execve fs/exec.c:2027 [inline]
__do_sys_execve fs/exec.c:2103 [inline]
__se_sys_execve fs/exec.c:2098 [inline]
__x64_sys_execve+0x8e/0xa0 fs/exec.c:2098
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
-> #2 (&tty->write_wait){-.-.}-{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
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xf5/0x1c0 kernel/sched/wait.c:157
tty_port_default_wakeup+0xa8/0x100 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1828
serial8250_handle_irq+0x505/0x600 drivers/tty/serial/8250/8250_port.c:1924
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x292/0xa70 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xff/0x2b0 kernel/irq/handle.c:213
handle_edge_irq+0x245/0xbf0 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:231 [inline]
__common_interrupt+0xd7/0x1f0 arch/x86/kernel/irq.c:250
common_interrupt+0xae/0xd0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:592
process_output_block drivers/tty/n_tty.c:592 [inline]
n_tty_write+0xd7e/0x1280 drivers/tty/n_tty.c:2339
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x561/0x920 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2174 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacd/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
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
-> #1 (&port_lock_key){-.-.}-{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
serial8250_console_write+0x19d/0x1180 drivers/tty/serial/8250/8250_port.c:3354
console_unlock+0xced/0x12b0 kernel/printk/printk.c:2744
vprintk_emit+0xbf/0x150 kernel/printk/printk.c:2274
_printk+0xd1/0x120 kernel/printk/printk.c:2299
register_console+0x65a/0x940 kernel/printk/printk.c:3107
univ8250_console_init+0x41/0x50 drivers/tty/serial/8250/8250_core.c:690
console_init+0x18c/0x660 kernel/printk/printk.c:3207
start_kernel+0x301/0x540 init/main.c:1076
secondary_startup_64_no_verify+0xb1/0xbb
-> #0 (console_owner){....}-{0:0}:
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
console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805
console_unlock+0xa47/0x12b0 kernel/printk/printk.c:2741
vprintk_emit+0xbf/0x150 kernel/printk/printk.c:2274
_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_693483806bd7978c+0x5b/0x1fc
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:1878 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1915
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
context_switch kernel/sched/core.c:5013 [inline]
__schedule+0x1167/0x45b0 kernel/sched/core.c:6373
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6777
irqentry_exit+0x53/0x80 kernel/entry/common.c:432
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
get_current arch/x86/include/asm/current.h:15 [inline]
__syscall_enter_from_user_work kernel/entry/common.c:93 [inline]
syscall_enter_from_user_mode+0x37/0x240 kernel/entry/common.c:114
do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x66/0xd0
other info that might help us debug this:
Chain exists of:
console_owner --> &p->pi_lock --> &rq->__lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&rq->__lock);
lock(&p->pi_lock);
lock(&rq->__lock);
lock(console_owner);
*** DEADLOCK ***
3 locks held by syz.1.42/5240:
#0: ffff8880b903a318 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:475
#1: ffffffff8c91fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
#2: ffffffff8c7fc520 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0xa6/0x150 kernel/printk/printk.c:2273
stack backtrace:
CPU: 0 PID: 5240 Comm: syz.1.42 Not tainted 5.15.173-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/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
console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805
console_unlock+0xa47/0x12b0 kernel/printk/printk.c:2741
vprintk_emit+0xbf/0x150 kernel/printk/printk.c:2274
_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_693483806bd7978c+0x5b/0x1fc
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:1878 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1915
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
context_switch kernel/sched/core.c:5013 [inline]
__schedule+0x1167/0x45b0 kernel/sched/core.c:6373
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6777
irqentry_exit+0x53/0x80 kernel/entry/common.c:432
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:__syscall_enter_from_user_work kernel/entry/common.c:93 [inline]
RIP: 0010:syscall_enter_from_user_mode+0x37/0x240 kernel/entry/common.c:114
Code: 49 89 fe 48 8b 7c 24 30 e8 46 f6 ff ff e9 8d 01 00 00 e9 91 01 00 00 e8 07 7a 52 f7 e8 f2 77 52 f7 fb 65 4c 8b 3d b9 f5 cd 75 <49> 8b 5f 08 f6 c3 3f 0f 84 ce 00 00 00 f6 c3 20 74 17 4c 89 f7 e8
RSP: 0018:ffffc90002f07ef8 EFLAGS: 00000282
RAX: 3134d8a154bf5e00 RBX: ffffc90002f07f30 RCX: ffffffff9686af03
RDX: dffffc0000000000 RSI: ffffffff8a8b2a80 RDI: ffffffff8ad90540
RBP: ffffc90002f07f48 R08: ffffffff8186f220 R09: fffffbfff1bd2d3e
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: ffffc90002f07f58 R15: ffff8880199a8000
do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f345e674e9f
Code: Unable to access opcode bytes at RIP 0x7f345e674e75.
RSP: 002b:00007f345d8fd040 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f345e674e9f
RDX: 0000000000000001 RSI: 00007f345d8fd0b0 RDI: 0000000000000007
RBP: 00007f345d8fd0a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000001
R13: 000000000000000b R14: 00007f345e804f80 R15: 00007fff1544e908
CPU: 0 PID: 5240 Comm: syz.1.42 Not tainted 5.15.173-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/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_693483806bd7978c+0x5b/0x1fc
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:1878 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1915
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
context_switch kernel/sched/core.c:5013 [inline]
__schedule+0x1167/0x45b0 kernel/sched/core.c:6373
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6777
irqentry_exit+0x53/0x80 kernel/entry/common.c:432
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:__syscall_enter_from_user_work kernel/entry/common.c:93 [inline]
RIP: 0010:syscall_enter_from_user_mode+0x37/0x240 kernel/entry/common.c:114
Code: 49 89 fe 48 8b 7c 24 30 e8 46 f6 ff ff e9 8d 01 00 00 e9 91 01 00 00 e8 07 7a 52 f7 e8 f2 77 52 f7 fb 65 4c 8b 3d b9 f5 cd 75 <49> 8b 5f 08 f6 c3 3f 0f 84 ce 00 00 00 f6 c3 20 74 17 4c 89 f7 e8
RSP: 0018:ffffc90002f07ef8 EFLAGS: 00000282
RAX: 3134d8a154bf5e00 RBX: ffffc90002f07f30 RCX: ffffffff9686af03
RDX: dffffc0000000000 RSI: ffffffff8a8b2a80 RDI: ffffffff8ad90540
RBP: ffffc90002f07f48 R08: ffffffff8186f220 R09: fffffbfff1bd2d3e
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000001 R14: ffffc90002f07f58 R15: ffff8880199a8000
do_syscall_64+0x1e/0xb0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f345e674e9f
Code: Unable to access opcode bytes at RIP 0x7f345e674e75.
RSP: 002b:00007f345d8fd040 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f345e674e9f
RDX: 0000000000000001 RSI: 00007f345d8fd0b0 RDI: 0000000000000007
RBP: 00007f345d8fd0a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000001
R13: 000000000000000b R14: 00007f345e804f80 R15: 00007fff1544e908
----------------
Code disassembly (best guess):
0: 49 89 fe mov %rdi,%r14
3: 48 8b 7c 24 30 mov 0x30(%rsp),%rdi
8: e8 46 f6 ff ff call 0xfffff653
d: e9 8d 01 00 00 jmp 0x19f
12: e9 91 01 00 00 jmp 0x1a8
17: e8 07 7a 52 f7 call 0xf7527a23
1c: e8 f2 77 52 f7 call 0xf7527813
21: fb sti
22: 65 4c 8b 3d b9 f5 cd mov %gs:0x75cdf5b9(%rip),%r15 # 0x75cdf5e3
29: 75
* 2a: 49 8b 5f 08 mov 0x8(%r15),%rbx <-- trapping instruction
2e: f6 c3 3f test $0x3f,%bl
31: 0f 84 ce 00 00 00 je 0x105
37: f6 c3 20 test $0x20,%bl
3a: 74 17 je 0x53
3c: 4c 89 f7 mov %r14,%rdi
3f: e8 .byte 0xe8