FAULT_INJECTION: forcing a failure.
name fail_page_alloc, interval 1, probability 0, space 0, times 0
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.6207/21622 is trying to acquire lock:
ffffffff8c1111c0 (console_owner){-.-.}-{0:0}, at: console_lock_spinning_enable+0x2c/0x60 kernel/printk/printk.c:1802
but task is already holding lock:
ffff88805506ba38 (&trie->lock){-...}-{2:2}, at: trie_update_elem+0xc7/0xc50 kernel/bpf/lpm_trie.c:323
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #5 (&trie->lock){-...}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
trie_delete_elem+0x90/0x710 kernel/bpf/lpm_trie.c:467
0xffffffffa00305ba
bpf_dispatcher_nop_func include/linux/bpf.h:888 [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+0x15b/0x2d0 kernel/trace/bpf_trace.c:1915
trace_tlb_flush+0xe6/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x6e3/0x9a0 arch/x86/mm/tlb.c:-1
context_switch kernel/sched/core.c:5035 [inline]
__schedule+0x1024/0x4390 kernel/sched/core.c:6395
preempt_schedule_irq+0xb1/0x150 kernel/sched/core.c:6799
irqentry_exit+0x63/0x70 kernel/entry/common.c:432
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
lock_acquire+0x1f2/0x3f0 kernel/locking/lockdep.c:5627
rcu_lock_acquire+0x2a/0x30 include/linux/rcupdate.h:313
rcu_read_lock include/linux/rcupdate.h:740 [inline]
batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
batadv_nc_worker+0xc9/0x5c0 net/batman-adv/network-coding.c:723
process_one_work+0x863/0x1000 kernel/workqueue.c:2310
worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
-> #4 (&rq->__lock){-.-.}-{2:2}:
_raw_spin_lock_nested+0x2e/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+0x5c/0x350 kernel/sched/fair.c:11499
sched_cgroup_fork+0x2c6/0x320 kernel/sched/core.c:4485
copy_process+0x22d1/0x3e00 kernel/fork.c:2395
kernel_clone+0x219/0x930 kernel/fork.c:2679
kernel_thread+0xc8/0x120 kernel/fork.c:2731
rest_init+0x21/0x330 init/main.c:720
start_kernel+0x486/0x530 init/main.c:1154
secondary_startup_64_no_verify+0xb1/0xbb
-> #3 (&p->pi_lock){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
try_to_wake_up+0x5c/0x1050 kernel/sched/core.c:4049
__wake_up_common+0x2a4/0x4e0 kernel/sched/wait.c:108
__wake_up_common_lock kernel/sched/wait.c:138 [inline]
__wake_up+0x108/0x180 kernel/sched/wait.c:157
tty_port_default_wakeup+0xa5/0xf0 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x629/0x830 drivers/tty/serial/8250/8250_port.c:1828
serial8250_handle_irq+0x519/0x610 drivers/tty/serial/8250/8250_port.c:1924
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x291/0x9b0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242
asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:667
get_lock_parent_ip include/linux/ftrace.h:855 [inline]
preempt_latency_start kernel/sched/core.c:5490 [inline]
preempt_count_add+0x85/0x190 kernel/sched/core.c:5515
unwind_next_frame+0xac/0x1d90 arch/x86/kernel/unwind_orc.c:433
arch_stack_walk+0x10c/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x98/0xe0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
__kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3225 [inline]
slab_alloc mm/slub.c:3233 [inline]
kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
vm_area_dup+0x1e/0xb0 kernel/fork.c:358
__split_vma+0xb1/0x410 mm/mmap.c:2730
__do_munmap+0x375/0xdc0 mm/mmap.c:2856
do_munmap mm/mmap.c:2910 [inline]
munmap_vma_range mm/mmap.c:603 [inline]
__mmap_region mm/mmap.c:1757 [inline]
mmap_region+0x8bb/0x1660 mm/mmap.c:2933
do_mmap+0x81f/0xea0 mm/mmap.c:1586
vm_mmap_pgoff+0x1b2/0x2b0 mm/util.c:551
ksys_mmap_pgoff+0x542/0x780 mm/mmap.c:1635
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
-> #2 (&tty->write_wait){-...}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xed/0x180 kernel/sched/wait.c:157
tty_port_default_wakeup+0xa5/0xf0 drivers/tty/tty_port.c:51
serial8250_tx_chars+0x629/0x830 drivers/tty/serial/8250/8250_port.c:1828
serial8250_handle_irq+0x519/0x610 drivers/tty/serial/8250/8250_port.c:1924
serial8250_default_handle_irq+0xb4/0x1a0 drivers/tty/serial/8250/8250_port.c:1941
serial8250_interrupt+0x9b/0x1c0 drivers/tty/serial/8250/8250_core.c:127
__handle_irq_event_percpu+0x291/0x9b0 kernel/irq/handle.c:156
handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
handle_irq_event+0xa5/0x220 kernel/irq/handle.c:213
handle_edge_irq+0x243/0xb20 kernel/irq/chip.c:819
generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
handle_irq arch/x86/kernel/irq.c:233 [inline]
__common_interrupt+0xd7/0x1e0 arch/x86/kernel/irq.c:252
common_interrupt+0xb0/0xd0 arch/x86/kernel/irq.c:242
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+0xa5/0x100 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [inline]
uart_write+0x62f/0x880 drivers/tty/serial/serial_core.c:592
process_output_block drivers/tty/n_tty.c:592 [inline]
n_tty_write+0xd21/0x1210 drivers/tty/n_tty.c:2339
do_tty_write drivers/tty/tty_io.c:1038 [inline]
file_tty_write+0x557/0x910 drivers/tty/tty_io.c:1110
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x712/0xd00 fs/read_write.c:594
ksys_write+0x14d/0x250 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
-> #1 (&port_lock_key){-.-.}-{2:2}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
serial8250_console_write+0x170/0xf80 drivers/tty/serial/8250/8250_port.c:3362
call_console_drivers kernel/printk/printk.c:-1 [inline]
console_unlock+0xc86/0x1200 kernel/printk/printk.c:2744
vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274
_printk+0xcc/0x110 kernel/printk/printk.c:2299
register_console+0x682/0x960 kernel/printk/printk.c:3107
univ8250_console_init+0x41/0x50 drivers/tty/serial/8250/8250_core.c:690
console_init+0x177/0x5d0 kernel/printk/printk.c:3207
start_kernel+0x2f9/0x530 init/main.c:1090
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 kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805
console_unlock+0x9f8/0x1200 kernel/printk/printk.c:2741
vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274
_printk+0xcc/0x110 kernel/printk/printk.c:2299
fail_dump lib/fault-inject.c:45 [inline]
should_fail+0x36d/0x4c0 lib/fault-inject.c:146
prepare_alloc_pages+0x1e4/0x5f0 mm/page_alloc.c:5263
__alloc_pages+0x10e/0x470 mm/page_alloc.c:5476
__alloc_pages_node include/linux/gfp.h:570 [inline]
alloc_pages_node include/linux/gfp.h:584 [inline]
kmalloc_large_node+0x7d/0x190 mm/slub.c:4426
__kmalloc_node+0x232/0x3b0 mm/slub.c:4442
kmalloc_node include/linux/slab.h:630 [inline]
bpf_map_kmalloc_node+0xba/0x140 kernel/bpf/syscall.c:432
lpm_trie_node_alloc kernel/bpf/lpm_trie.c:290 [inline]
trie_update_elem+0x1cc/0xc50 kernel/bpf/lpm_trie.c:332
bpf_map_update_value+0x57d/0x650 kernel/bpf/syscall.c:223
generic_map_update_batch+0x525/0x7c0 kernel/bpf/syscall.c:1430
bpf_map_do_batch+0x466/0x600 kernel/bpf/syscall.c:-1
__sys_bpf+0x601/0x670 kernel/bpf/syscall.c:-1
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 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_owner --> &rq->__lock --> &trie->lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&trie->lock);
lock(&rq->__lock);
lock(&trie->lock);
lock(console_owner);
*** DEADLOCK ***
3 locks held by syz.6.6207/21622:
#0: ffffffff8c11c760 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:312
#1: ffff88805506ba38 (&trie->lock){-...}-{2:2}, at: trie_update_elem+0xc7/0xc50 kernel/bpf/lpm_trie.c:323
#2: ffffffff8c1112a0 (console_lock){+.+.}-{0:0}, at: vprintk_emit+0xa7/0x150 kernel/printk/printk.c:2273
stack backtrace:
CPU: 0 PID: 21622 Comm: syz.6.6207 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
check_noncircular+0x274/0x310 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 kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
console_lock_spinning_enable+0x51/0x60 kernel/printk/printk.c:1805
console_unlock+0x9f8/0x1200 kernel/printk/printk.c:2741
vprintk_emit+0xc0/0x150 kernel/printk/printk.c:2274
_printk+0xcc/0x110 kernel/printk/printk.c:2299
fail_dump lib/fault-inject.c:45 [inline]
should_fail+0x36d/0x4c0 lib/fault-inject.c:146
prepare_alloc_pages+0x1e4/0x5f0 mm/page_alloc.c:5263
__alloc_pages+0x10e/0x470 mm/page_alloc.c:5476
__alloc_pages_node include/linux/gfp.h:570 [inline]
alloc_pages_node include/linux/gfp.h:584 [inline]
kmalloc_large_node+0x7d/0x190 mm/slub.c:4426
__kmalloc_node+0x232/0x3b0 mm/slub.c:4442
kmalloc_node include/linux/slab.h:630 [inline]
bpf_map_kmalloc_node+0xba/0x140 kernel/bpf/syscall.c:432
lpm_trie_node_alloc kernel/bpf/lpm_trie.c:290 [inline]
trie_update_elem+0x1cc/0xc50 kernel/bpf/lpm_trie.c:332
bpf_map_update_value+0x57d/0x650 kernel/bpf/syscall.c:223
generic_map_update_batch+0x525/0x7c0 kernel/bpf/syscall.c:1430
bpf_map_do_batch+0x466/0x600 kernel/bpf/syscall.c:-1
__sys_bpf+0x601/0x670 kernel/bpf/syscall.c:-1
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f715bf4b6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f715a1b2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f715c1a1fa0 RCX: 00007f715bf4b6c9
RDX: 0000000000000038 RSI: 0000200000000500 RDI: 000000000000001a
RBP: 00007f715a1b2090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007f715c1a2038 R14: 00007f715c1a1fa0 R15: 00007ffc7ffd0f48
CPU: 0 PID: 21622 Comm: syz.6.6207 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
fail_dump lib/fault-inject.c:52 [inline]
should_fail+0x38c/0x4c0 lib/fault-inject.c:146
prepare_alloc_pages+0x1e4/0x5f0 mm/page_alloc.c:5263
__alloc_pages+0x10e/0x470 mm/page_alloc.c:5476
__alloc_pages_node include/linux/gfp.h:570 [inline]
alloc_pages_node include/linux/gfp.h:584 [inline]
kmalloc_large_node+0x7d/0x190 mm/slub.c:4426
__kmalloc_node+0x232/0x3b0 mm/slub.c:4442
kmalloc_node include/linux/slab.h:630 [inline]
bpf_map_kmalloc_node+0xba/0x140 kernel/bpf/syscall.c:432
lpm_trie_node_alloc kernel/bpf/lpm_trie.c:290 [inline]
trie_update_elem+0x1cc/0xc50 kernel/bpf/lpm_trie.c:332
bpf_map_update_value+0x57d/0x650 kernel/bpf/syscall.c:223
generic_map_update_batch+0x525/0x7c0 kernel/bpf/syscall.c:1430
bpf_map_do_batch+0x466/0x600 kernel/bpf/syscall.c:-1
__sys_bpf+0x601/0x670 kernel/bpf/syscall.c:-1
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f715bf4b6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f715a1b2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f715c1a1fa0 RCX: 00007f715bf4b6c9
RDX: 0000000000000038 RSI: 0000200000000500 RDI: 000000000000001a
RBP: 00007f715a1b2090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007f715c1a2038 R14: 00007f715c1a1fa0 R15: 00007ffc7ffd0f48