------------[ cut here ]------------
======================================================
WARNING: possible circular locking dependency detected
6.1.83-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.0/3644 is trying to acquire lock:
ffffffff8d006ad8 ((console_sem).lock){....}-{2:2}, at: down_trylock+0x1c/0xa0 kernel/locking/semaphore.c:139
but task is already holding lock:
ffff8880b9828358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&base->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
lock_timer_base+0x120/0x260 kernel/time/timer.c:999
__mod_timer+0x1cb/0xee0 kernel/time/timer.c:1072
queue_delayed_work_on+0x156/0x250 kernel/workqueue.c:1704
psi_task_change+0xf9/0x270 kernel/sched/psi.c:924
psi_enqueue kernel/sched/stats.h:141 [inline]
enqueue_task+0x2fd/0x3a0 kernel/sched/core.c:2056
activate_task kernel/sched/core.c:2088 [inline]
wake_up_new_task+0x4f5/0xca0 kernel/sched/core.c:4742
kernel_clone+0x4ed/0x920 kernel/fork.c:2713
user_mode_thread+0x12e/0x190 kernel/fork.c:2758
rest_init+0x23/0x300 init/main.c:697
start_kernel+0x0/0x53f init/main.c:892
start_kernel+0x496/0x53f init/main.c:1139
secondary_startup_64_no_verify+0xcf/0xdb
-> #2 (&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:11869
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:697
start_kernel+0x0/0x53f init/main.c:892
start_kernel+0x496/0x53f init/main.c:1139
secondary_startup_64_no_verify+0xcf/0xdb
-> #1 (&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
up+0x6e/0x90 kernel/locking/semaphore.c:191
__up_console_sem+0x11a/0x1e0 kernel/printk/printk.c:260
__console_unlock kernel/printk/printk.c:2691 [inline]
console_unlock+0x591/0x7c0 kernel/printk/printk.c:2902
vprintk_emit+0x523/0x740 kernel/printk/printk.c:2297
dev_vprintk_emit+0x2aa/0x323 drivers/base/core.c:4902
dev_printk_emit+0xd9/0x118 drivers/base/core.c:4913
_dev_warn+0x11e/0x165 drivers/base/core.c:4969
_request_firmware+0xc4c/0x1200 drivers/base/firmware_loader/main.c:852
request_firmware_work_func+0x126/0x270 drivers/base/firmware_loader/main.c:1105
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:307
-> #0 ((console_sem).lock){....}-{2:2}:
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
__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:139
__down_trylock_console_sem+0x105/0x250 kernel/printk/printk.c:243
console_trylock kernel/printk/printk.c:2644 [inline]
console_trylock_spinning kernel/printk/printk.c:1896 [inline]
vprintk_emit+0x1ee/0x740 kernel/printk/printk.c:2296
_printk+0xd1/0x111 kernel/printk/printk.c:2322
__report_bug lib/bug.c:195 [inline]
report_bug+0x342/0x500 lib/bug.c:219
handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:324
exc_invalid_op+0x16/0x40 arch/x86/kernel/traps.c:345
asm_exc_invalid_op+0x16/0x20 arch/x86/include/asm/idtentry.h:568
__local_bh_enable_ip+0x1b3/0x1f0
sock_hash_delete_elem+0x1a0/0x2f0 net/core/sock_map.c:940
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
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:2273 [inline]
bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313
trace_timer_start include/trace/events/timer.h:53 [inline]
enqueue_timer+0x440/0x600 kernel/time/timer.c:609
__mod_timer+0x92b/0xee0
tun_flow_init drivers/net/tun.c:1363 [inline]
tun_net_init+0x26f/0x530 drivers/net/tun.c:993
register_netdevice+0x5fc/0x1720 net/core/dev.c:10029
tun_set_iff+0x861/0xe80 drivers/net/tun.c:2846
__tun_chr_ioctl+0x78e/0x2430 drivers/net/tun.c:3109
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
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_sem).lock --> &rq->__lock --> &base->lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&base->lock);
lock(&rq->__lock);
lock(&base->lock);
lock((console_sem).lock);
*** DEADLOCK ***
3 locks held by syz-executor.0/3644:
#0: ffffffff8e2991e8 (rtnl_mutex){+.+.}-{3:3}, at: __tun_chr_ioctl+0x465/0x2430 drivers/net/tun.c:3099
#1: ffff8880b9828358 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x120/0x260 kernel/time/timer.c:999
#2: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#2: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#2: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
#2: ffffffff8d12a940 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2313
stack backtrace:
CPU: 0 PID: 3644 Comm: syz-executor.0 Not tainted 6.1.83-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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
__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:139
__down_trylock_console_sem+0x105/0x250 kernel/printk/printk.c:243
console_trylock kernel/printk/printk.c:2644 [inline]
console_trylock_spinning kernel/printk/printk.c:1896 [inline]
vprintk_emit+0x1ee/0x740 kernel/printk/printk.c:2296
_printk+0xd1/0x111 kernel/printk/printk.c:2322
__report_bug lib/bug.c:195 [inline]
report_bug+0x342/0x500 lib/bug.c:219
handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:324
exc_invalid_op+0x16/0x40 arch/x86/kernel/traps.c:345
asm_exc_invalid_op+0x16/0x20 arch/x86/include/asm/idtentry.h:568
RIP: 0010:__local_bh_enable_ip+0x1b3/0x1f0 kernel/softirq.c:376
Code: 04 25 28 00 00 00 48 3b 44 24 60 75 4a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b e9 d0 fe ff ff e8 3f 00 00 00 eb a2 <0f> 0b e9 02 ff ff ff 48 c7 c1 a4 99 73 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc90004f0f780 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 1ffff920009e1ef4 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8897e790
RBP: ffffc90004f0f840 R08: dffffc0000000000 R09: ffffed100446da02
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 0000000000000004 R14: ffffc90004f0f7c0 R15: 0000000000000201
sock_hash_delete_elem+0x1a0/0x2f0 net/core/sock_map.c:940
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
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:2273 [inline]
bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313
trace_timer_start include/trace/events/timer.h:53 [inline]
enqueue_timer+0x440/0x600 kernel/time/timer.c:609
__mod_timer+0x92b/0xee0
tun_flow_init drivers/net/tun.c:1363 [inline]
tun_net_init+0x26f/0x530 drivers/net/tun.c:993
register_netdevice+0x5fc/0x1720 net/core/dev.c:10029
tun_set_iff+0x861/0xe80 drivers/net/tun.c:2846
__tun_chr_ioctl+0x78e/0x2430 drivers/net/tun.c:3109
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
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:0x7f549547dda9
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:00007f549612a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f54955abf80 RCX: 00007f549547dda9
RDX: 00000000200016c0 RSI: 00000000400454ca RDI: 0000000000000005
RBP: 00007f54954ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f54955abf80 R15: 00007ffc77fd5228
WARNING: CPU: 0 PID: 3644 at kernel/softirq.c:376 __local_bh_enable_ip+0x1b3/0x1f0
Modules linked in:
CPU: 0 PID: 3644 Comm: syz-executor.0 Not tainted 6.1.83-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:__local_bh_enable_ip+0x1b3/0x1f0 kernel/softirq.c:376
Code: 04 25 28 00 00 00 48 3b 44 24 60 75 4a 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 0b e9 d0 fe ff ff e8 3f 00 00 00 eb a2 <0f> 0b e9 02 ff ff ff 48 c7 c1 a4 99 73 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc90004f0f780 EFLAGS: 00010046
RAX: 0000000000000000 RBX: 1ffff920009e1ef4 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8897e790
RBP: ffffc90004f0f840 R08: dffffc0000000000 R09: ffffed100446da02
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 0000000000000004 R14: ffffc90004f0f7c0 R15: 0000000000000201
FS: 00007f549612a6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c00241a000 CR3: 00000000585de000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
sock_hash_delete_elem+0x1a0/0x2f0 net/core/sock_map.c:940
bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e
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:2273 [inline]
bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2313
trace_timer_start include/trace/events/timer.h:53 [inline]
enqueue_timer+0x440/0x600 kernel/time/timer.c:609
__mod_timer+0x92b/0xee0
tun_flow_init drivers/net/tun.c:1363 [inline]
tun_net_init+0x26f/0x530 drivers/net/tun.c:993
register_netdevice+0x5fc/0x1720 net/core/dev.c:10029
tun_set_iff+0x861/0xe80 drivers/net/tun.c:2846
__tun_chr_ioctl+0x78e/0x2430 drivers/net/tun.c:3109
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
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:0x7f549547dda9
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:00007f549612a0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f54955abf80 RCX: 00007f549547dda9
RDX: 00000000200016c0 RSI: 00000000400454ca RDI: 0000000000000005
RBP: 00007f54954ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f54955abf80 R15: 00007ffc77fd5228