FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 1
======================================================
WARNING: possible circular locking dependency detected
6.1.115-syzkaller #0 Not tainted
------------------------------------------------------
syz.2.8/4353 is trying to acquire lock:
ffffffff8d31f4c0 (console_owner){....}-{0:0}, at: console_lock_spinning_enable kernel/printk/printk.c:1818 [inline]
ffffffff8d31f4c0 (console_owner){....}-{0:0}, at: console_emit_next_record+0xa9c/0x1000 kernel/printk/printk.c:2774
but task is already holding lock:
ffff8880b8e3a9d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #4 (&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:11877
sched_cgroup_fork+0x374/0x400 kernel/sched/core.c:4682
copy_process+0x2442/0x4060 kernel/fork.c:2381
kernel_clone+0x222/0x920 kernel/fork.c:2679
user_mode_thread+0x12e/0x190 kernel/fork.c:2755
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
-> #3 (&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:4108
__wake_up_common+0x2a0/0x4e0 kernel/sched/wait.c:107
__wake_up_common_lock kernel/sched/wait.c:138 [inline]
__wake_up+0x11a/0x1c0 kernel/sched/wait.c:160
tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:71
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1854
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1961
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1981
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
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:682
memcpy_erms+0x8/0x10 arch/x86/lib/memcpy_64.S:56
__nla_put lib/nlattr.c:1013 [inline]
nla_put+0x12d/0x1e0 lib/nlattr.c:1071
rtnl_fill_ifinfo+0x171a/0x2090 net/core/rtnetlink.c:1840
rtnl_dump_ifinfo+0xbb0/0x1350 net/core/rtnetlink.c:2222
netlink_dump+0x5a2/0xca0 net/netlink/af_netlink.c:2233
netlink_recvmsg+0x6ca/0x1180 net/netlink/af_netlink.c:1956
____sys_recvmsg+0x285/0x530
___sys_recvmsg net/socket.c:2780 [inline]
__sys_recvmsg+0x2e9/0x3d0 net/socket.c:2810
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 (&tty->write_wait){-...}-{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
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xfd/0x1c0 kernel/sched/wait.c:160
tty_port_default_wakeup+0xa2/0xf0 drivers/tty/tty_port.c:71
serial8250_tx_chars+0x60d/0x800 drivers/tty/serial/8250/8250_port.c:1854
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1961
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1981
serial8250_interrupt+0xa1/0x1e0 drivers/tty/serial/8250/8250_core.c:126
__handle_irq_event_percpu+0x2a8/0xb20 kernel/irq/handle.c:158
handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
handle_irq_event+0x85/0x1e0 kernel/irq/handle.c:210
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:682
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:406 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:602
process_output_block drivers/tty/n_tty.c:586 [inline]
n_tty_write+0xd7f/0x1260 drivers/tty/n_tty.c:2377
do_tty_write drivers/tty/tty_io.c:1018 [inline]
file_tty_write+0x504/0x890 drivers/tty/tty_io.c:1089
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x857/0xbc0 fs/read_write.c:584
ksys_write+0x19c/0x2c0 fs/read_write.c:637
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
-> #1 (&port_lock_key){-...}-{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
serial8250_console_write+0x19d/0x1750 drivers/tty/serial/8250/8250_port.c:3404
call_console_driver kernel/printk/printk.c:1977 [inline]
console_emit_next_record+0xbb4/0x1000 kernel/printk/printk.c:2777
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2906
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2303
_printk+0xd1/0x111 kernel/printk/printk.c:2328
register_console+0x6b9/0x9a0 kernel/printk/printk.c:3269
univ8250_console_init+0x41/0x43 drivers/tty/serial/8250/8250_core.c:687
console_init+0x1d6/0x7f3 kernel/printk/printk.c:3359
start_kernel+0x30b/0x53f init/main.c:1076
secondary_startup_64_no_verify+0xcf/0xdb
-> #0 (console_owner){....}-{0:0}:
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
console_lock_spinning_enable kernel/printk/printk.c:1818 [inline]
console_emit_next_record+0xabd/0x1000 kernel/printk/printk.c:2774
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2906
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2303
_printk+0xd1/0x111 kernel/printk/printk.c:2328
fail_dump lib/fault-inject.c:45 [inline]
should_fail_ex+0x387/0x4d0 lib/fault-inject.c:147
strncpy_from_user+0x32/0x360 lib/strncpy_from_user.c:118
strncpy_from_user_nofault+0x6c/0x130 mm/maccess.c:186
bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:204 [inline]
____bpf_probe_read_user_str kernel/trace/bpf_trace.c:213 [inline]
bpf_probe_read_user_str+0x26/0x70 kernel/trace/bpf_trace.c:210
bpf_prog_bc7c5c6b9645592f+0x35/0x37
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:2271 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2312
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2128/0x4570 kernel/sched/core.c:6555
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870
irqentry_exit+0x53/0x80 kernel/entry/common.c:439
asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:696
lock_release+0x637/0xa20 kernel/locking/lockdep.c:5686
__mutex_unlock_slowpath+0xde/0x750 kernel/locking/mutex.c:907
fdput_pos include/linux/file.h:80 [inline]
ksys_write+0x23a/0x2c0 fs/read_write.c:640
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:
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.2.8/4353:
#0: ffff8880b8e3a9d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x26/0x140 kernel/sched/core.c:537
#1: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#1: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#1: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2270 [inline]
#1: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run4+0x16a/0x470 kernel/trace/bpf_trace.c:2312
#2: ffffffff8d207220 (console_lock){+.+.}-{0:0}, at: _printk+0xd1/0x111 kernel/printk/printk.c:2328
stack backtrace:
CPU: 0 PID: 4353 Comm: syz.2.8 Not tainted 6.1.115-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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
console_lock_spinning_enable kernel/printk/printk.c:1818 [inline]
console_emit_next_record+0xabd/0x1000 kernel/printk/printk.c:2774
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2906
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2303
_printk+0xd1/0x111 kernel/printk/printk.c:2328
fail_dump lib/fault-inject.c:45 [inline]
should_fail_ex+0x387/0x4d0 lib/fault-inject.c:147
strncpy_from_user+0x32/0x360 lib/strncpy_from_user.c:118
strncpy_from_user_nofault+0x6c/0x130 mm/maccess.c:186
bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:204 [inline]
____bpf_probe_read_user_str kernel/trace/bpf_trace.c:213 [inline]
bpf_probe_read_user_str+0x26/0x70 kernel/trace/bpf_trace.c:210
bpf_prog_bc7c5c6b9645592f+0x35/0x37
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:2271 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2312
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2128/0x4570 kernel/sched/core.c:6555
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870
irqentry_exit+0x53/0x80 kernel/entry/common.c:439
asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:696
RIP: 0010:lock_release+0x637/0xa20 kernel/locking/lockdep.c:5686
Code: 3c 3b 00 74 08 4c 89 f7 e8 46 51 77 00 f6 84 24 91 00 00 00 02 75 6f 41 f7 c5 00 02 00 00 74 01 fb 48 c7 44 24 60 0e 36 e0 45 <4b> c7 04 27 00 00 00 00 4b c7 44 27 08 00 00 00 00 65 48 8b 04 25
RSP: 0018:ffffc90004997be0 EFLAGS: 00000206
RAX: 0000000000000001 RBX: 1ffff92000932f8e RCX: ffffc90004997c03
RDX: 0000000000000000 RSI: ffffffff8b0c1440 RDI: ffffffff8b5d7540
RBP: ffffc90004997d10 R08: dffffc0000000000 R09: fffffbfff1d34076
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff92000932f88
R13: 0000000000000246 R14: ffffc90004997c70 R15: dffffc0000000000
__mutex_unlock_slowpath+0xde/0x750 kernel/locking/mutex.c:907
fdput_pos include/linux/file.h:80 [inline]
ksys_write+0x23a/0x2c0 fs/read_write.c:640
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:0x7fdb9f97d1ff
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 c9 8d 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 1c 8e 02 00 48
RSP: 002b:00007fdba06f2030 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007fdb9f97d1ff
RDX: 0000000000000001 RSI: 00007fdba06f2090 RDI: 0000000000000008
RBP: 00007fdba06f2090 R08: 0000000000000000 R09: 00007fdba06f1df7
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000001
R13: 0000000000000000 R14: 00007fdb9fb36130 R15: 00007ffe56961e78
CPU: 0 PID: 4353 Comm: syz.2.8 Not tainted 6.1.115-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
fail_dump lib/fault-inject.c:52 [inline]
should_fail_ex+0x3a6/0x4d0 lib/fault-inject.c:147
strncpy_from_user+0x32/0x360 lib/strncpy_from_user.c:118
strncpy_from_user_nofault+0x6c/0x130 mm/maccess.c:186
bpf_probe_read_user_str_common kernel/trace/bpf_trace.c:204 [inline]
____bpf_probe_read_user_str kernel/trace/bpf_trace.c:213 [inline]
bpf_probe_read_user_str+0x26/0x70 kernel/trace/bpf_trace.c:210
bpf_prog_bc7c5c6b9645592f+0x35/0x37
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:2271 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2312
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2128/0x4570 kernel/sched/core.c:6555
preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6870
irqentry_exit+0x53/0x80 kernel/entry/common.c:439
asm_sysvec_reschedule_ipi+0x16/0x20 arch/x86/include/asm/idtentry.h:696
RIP: 0010:lock_release+0x637/0xa20 kernel/locking/lockdep.c:5686
Code: 3c 3b 00 74 08 4c 89 f7 e8 46 51 77 00 f6 84 24 91 00 00 00 02 75 6f 41 f7 c5 00 02 00 00 74 01 fb 48 c7 44 24 60 0e 36 e0 45 <4b> c7 04 27 00 00 00 00 4b c7 44 27 08 00 00 00 00 65 48 8b 04 25
RSP: 0018:ffffc90004997be0 EFLAGS: 00000206
RAX: 0000000000000001 RBX: 1ffff92000932f8e RCX: ffffc90004997c03
RDX: 0000000000000000 RSI: ffffffff8b0c1440 RDI: ffffffff8b5d7540
RBP: ffffc90004997d10 R08: dffffc0000000000 R09: fffffbfff1d34076
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff92000932f88
R13: 0000000000000246 R14: ffffc90004997c70 R15: dffffc0000000000
__mutex_unlock_slowpath+0xde/0x750 kernel/locking/mutex.c:907
fdput_pos include/linux/file.h:80 [inline]
ksys_write+0x23a/0x2c0 fs/read_write.c:640
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:0x7fdb9f97d1ff
Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 c9 8d 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 1c 8e 02 00 48
RSP: 002b:00007fdba06f2030 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007fdb9f97d1ff
RDX: 0000000000000001 RSI: 00007fdba06f2090 RDI: 0000000000000008
RBP: 00007fdba06f2090 R08: 0000000000000000 R09: 00007fdba06f1df7
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000001
R13: 0000000000000000 R14: 00007fdb9fb36130 R15: 00007ffe56961e78
nbd: must specify a device to reconfigure
----------------
Code disassembly (best guess):
0: 3c 3b cmp $0x3b,%al
2: 00 74 08 4c add %dh,0x4c(%rax,%rcx,1)
6: 89 f7 mov %esi,%edi
8: e8 46 51 77 00 call 0x775153
d: f6 84 24 91 00 00 00 testb $0x2,0x91(%rsp)
14: 02
15: 75 6f jne 0x86
17: 41 f7 c5 00 02 00 00 test $0x200,%r13d
1e: 74 01 je 0x21
20: fb sti
21: 48 c7 44 24 60 0e 36 movq $0x45e0360e,0x60(%rsp)
28: e0 45
* 2a: 4b c7 04 27 00 00 00 movq $0x0,(%r15,%r12,1) <-- trapping instruction
31: 00
32: 4b c7 44 27 08 00 00 movq $0x0,0x8(%r15,%r12,1)
39: 00 00
3b: 65 gs
3c: 48 rex.W
3d: 8b .byte 0x8b
3e: 04 25 add $0x25,%al