------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.1.70-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.3/6954 is trying to acquire lock:
ffffffff8d11e780 (console_owner){-...}-{0:0}, at: console_lock_spinning_enable kernel/printk/printk.c:1805 [inline]
ffffffff8d11e780 (console_owner){-...}-{0:0}, at: console_emit_next_record+0x9fa/0xea0 kernel/printk/printk.c:2739
but task is already holding lock:
ffffffff8d188338 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:390 [inline]
ffffffff8d188338 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0x151/0x200 kernel/trace/bpf_trace.c:376
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #5 (trace_printk_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
____bpf_trace_printk kernel/trace/bpf_trace.c:390 [inline]
bpf_trace_printk+0x151/0x200 kernel/trace/bpf_trace.c:376
0xffffffffa0001fdf
bpf_dispatcher_nop_func include/linux/bpf.h:970 [inline]
__bpf_prog_run include/linux/filter.h:600 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2275 [inline]
bpf_trace_run4+0x253/0x470 kernel/trace/bpf_trace.c:2316
__traceiter_sched_switch+0x91/0xc0 include/trace/events/sched.h:222
trace_sched_switch include/trace/events/sched.h:222 [inline]
__schedule+0x2116/0x4550 kernel/sched/core.c:6555
schedule+0xbf/0x180 kernel/sched/core.c:6634
futex_wait_queue+0x149/0x1d0 kernel/futex/waitwake.c:355
futex_wait+0x203/0x5c0 kernel/futex/waitwake.c:656
do_futex+0x3b5/0x490 kernel/futex/syscalls.c:106
__do_sys_futex kernel/futex/syscalls.c:183 [inline]
__se_sys_futex+0x3d7/0x460 kernel/futex/syscalls.c:164
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #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:1354 [inline]
rq_lock kernel/sched/sched.h:1644 [inline]
task_fork_fair+0x5d/0x350 kernel/sched/fair.c:11863
sched_cgroup_fork+0x374/0x400 kernel/sched/core.c:4686
copy_process+0x2442/0x4060 kernel/fork.c:2384
kernel_clone+0x222/0x920 kernel/fork.c:2682
user_mode_thread+0x12e/0x190 kernel/fork.c:2758
rest_init+0x23/0x300 init/main.c:696
start_kernel+0x0/0x53f init/main.c:891
start_kernel+0x496/0x53f init/main.c:1138
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:4112
__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:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
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+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
in_lock_functions+0x1c/0x20 kernel/locking/spinlock.c:413
get_lock_parent_ip include/linux/ftrace.h:950 [inline]
preempt_latency_start kernel/sched/core.c:5689 [inline]
preempt_count_add+0x8f/0x180 kernel/sched/core.c:5714
unwind_next_frame+0xb3/0x2220 arch/x86/kernel/unwind_orc.c:433
arch_stack_walk+0x10d/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc+0xb2/0x230 mm/slab_common.c:968
kmalloc include/linux/slab.h:558 [inline]
tomoyo_realpath_from_path+0xcb/0x5d0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x240/0x4c0 security/tomoyo/file.c:771
security_file_open+0x5f/0xa0 security/security.c:1663
do_dentry_open+0x308/0x10f0 fs/open.c:869
do_open fs/namei.c:3558 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3715
do_filp_open+0x230/0x480 fs/namei.c:3742
do_sys_openat2+0x13b/0x500 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1345
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #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:1860
serial8250_handle_irq+0x4ff/0x6a0 drivers/tty/serial/8250/8250_port.c:1967
serial8250_default_handle_irq+0xc8/0x1e0 drivers/tty/serial/8250/8250_port.c:1987
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+0x9f/0xc0 arch/x86/kernel/irq.c:240
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:644
__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:405 [inline]
uart_write+0x6af/0x930 drivers/tty/serial/serial_core.c:600
process_output_block drivers/tty/n_tty.c:586 [inline]
n_tty_write+0xd7f/0x1260 drivers/tty/n_tty.c:2367
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:2248 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x7ae/0xba0 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+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
-> #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:3410
call_console_driver kernel/printk/printk.c:1942 [inline]
console_emit_next_record+0xb09/0xea0 kernel/printk/printk.c:2742
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2871
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2268
_printk+0xd1/0x111 kernel/printk/printk.c:2293
register_console+0x69e/0x990 kernel/printk/printk.c:3219
univ8250_console_init+0x41/0x43 drivers/tty/serial/8250/8250_core.c:687
console_init+0x1d6/0x7f3 kernel/printk/printk.c:3309
start_kernel+0x30b/0x53f init/main.c:1074
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:1805 [inline]
console_emit_next_record+0xa17/0xea0 kernel/printk/printk.c:2739
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2871
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2268
_printk+0xd1/0x111 kernel/printk/printk.c:2293
__warn_printk+0x233/0x350 kernel/panic.c:715
format_decode+0x12d2/0x1f10 lib/vsprintf.c:2661
bstr_printf+0x130/0x10c0 lib/vsprintf.c:3234
____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline]
bpf_trace_printk+0x186/0x200 kernel/trace/bpf_trace.c:376
bpf_prog_12183cdb1cd51dab+0x2e/0x32
bpf_dispatcher_nop_func include/linux/bpf.h:970 [inline]
__bpf_prog_run include/linux/filter.h:593 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
bpf_test_run+0x60c/0x8b0 net/bpf/test_run.c:402
bpf_prog_test_run_skb+0xaf1/0x13a0 net/bpf/test_run.c:1180
bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3633
__sys_bpf+0x3eb/0x6c0 kernel/bpf/syscall.c:4986
__do_sys_bpf kernel/bpf/syscall.c:5072 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5070 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5070
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
other info that might help us debug this:
Chain exists of:
console_owner --> &rq->__lock --> trace_printk_lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(trace_printk_lock);
lock(&rq->__lock);
lock(trace_printk_lock);
lock(console_owner);
*** DEADLOCK ***
3 locks held by syz-executor.3/6954:
#0: ffffffff8d12a320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:306 [inline]
#0: ffffffff8d12a320 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline]
#0: ffffffff8d12a320 (rcu_read_lock){....}-{1:2}, at: bpf_test_timer_enter+0x19/0x140 net/bpf/test_run.c:36
#1: ffffffff8d188338 (trace_printk_lock){-.-.}-{2:2}, at: ____bpf_trace_printk kernel/trace/bpf_trace.c:390 [inline]
#1: ffffffff8d188338 (trace_printk_lock){-.-.}-{2:2}, at: bpf_trace_printk+0x151/0x200 kernel/trace/bpf_trace.c:376
#2: ffffffff8d0064e0 (console_lock){+.+.}-{0:0}, at: _printk+0xd1/0x111 kernel/printk/printk.c:2293
stack backtrace:
CPU: 1 PID: 6954 Comm: syz-executor.3 Not tainted 6.1.70-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
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:1805 [inline]
console_emit_next_record+0xa17/0xea0 kernel/printk/printk.c:2739
console_unlock+0x278/0x7c0 kernel/printk/printk.c:2871
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2268
_printk+0xd1/0x111 kernel/printk/printk.c:2293
__warn_printk+0x233/0x350 kernel/panic.c:715
format_decode+0x12d2/0x1f10 lib/vsprintf.c:2661
bstr_printf+0x130/0x10c0 lib/vsprintf.c:3234
____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline]
bpf_trace_printk+0x186/0x200 kernel/trace/bpf_trace.c:376
bpf_prog_12183cdb1cd51dab+0x2e/0x32
bpf_dispatcher_nop_func include/linux/bpf.h:970 [inline]
__bpf_prog_run include/linux/filter.h:593 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
bpf_test_run+0x60c/0x8b0 net/bpf/test_run.c:402
bpf_prog_test_run_skb+0xaf1/0x13a0 net/bpf/test_run.c:1180
bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3633
__sys_bpf+0x3eb/0x6c0 kernel/bpf/syscall.c:4986
__do_sys_bpf kernel/bpf/syscall.c:5072 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5070 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5070
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fbe73a7cce9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbe748b90c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fbe73b9bf80 RCX: 00007fbe73a7cce9
RDX: 0000000000000028 RSI: 0000000020000080 RDI: 000000000000000a
RBP: 00007fbe73ac947a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fbe73b9bf80 R15: 00007ffdc1dd7688
Please remove unsupported % in format string
WARNING: CPU: 1 PID: 6954 at lib/vsprintf.c:2661 format_decode+0x12d2/0x1f10 lib/vsprintf.c:2661
Modules linked in:
CPU: 1 PID: 6954 Comm: syz-executor.3 Not tainted 6.1.70-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:format_decode+0x12d2/0x1f10 lib/vsprintf.c:2661
Code: da 03 01 48 b8 00 00 00 00 00 fc ff df 41 0f b6 04 07 84 c0 0f 85 30 0c 00 00 41 0f be 36 48 c7 c7 e0 7a 07 8c e8 be b8 cd f6 <0f> 0b e9 01 fa ff ff 48 8b 4c 24 18 80 e1 07 38 c1 0f 8c e3 ed ff
RSP: 0018:ffffc90004e9f6a0 EFLAGS: 00010046
RAX: 2e50db8e0446b100 RBX: 00000000ffffffdb RCX: 0000000000040000
RDX: ffffc9000bf44000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90004e9f790 R08: ffffffff8152806e R09: ffffed1017324f1c
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff0a00ffffff00
R13: ffff0000ffffff00 R14: ffffc90004e9f9ac R15: 1ffff920009d3f35
FS: 00007fbe748b96c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe47f8ef78 CR3: 0000000047cf6000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
bstr_printf+0x130/0x10c0 lib/vsprintf.c:3234
____bpf_trace_printk kernel/trace/bpf_trace.c:391 [inline]
bpf_trace_printk+0x186/0x200 kernel/trace/bpf_trace.c:376
bpf_prog_12183cdb1cd51dab+0x2e/0x32
bpf_dispatcher_nop_func include/linux/bpf.h:970 [inline]
__bpf_prog_run include/linux/filter.h:593 [inline]
bpf_prog_run include/linux/filter.h:607 [inline]
bpf_test_run+0x60c/0x8b0 net/bpf/test_run.c:402
bpf_prog_test_run_skb+0xaf1/0x13a0 net/bpf/test_run.c:1180
bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3633
__sys_bpf+0x3eb/0x6c0 kernel/bpf/syscall.c:4986
__do_sys_bpf kernel/bpf/syscall.c:5072 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5070 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5070
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fbe73a7cce9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbe748b90c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fbe73b9bf80 RCX: 00007fbe73a7cce9
RDX: 0000000000000028 RSI: 0000000020000080 RDI: 000000000000000a
RBP: 00007fbe73ac947a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fbe73b9bf80 R15: 00007ffdc1dd7688