============================= [ BUG: Invalid wait context ] 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0 Not tainted ----------------------------- syz.1.68/6089 is trying to lock: ffff8880b873aab0 (batched_entropy_u8.lock){..-.}-{3:3}, at: local_lock_acquire include/linux/local_lock_internal.h:29 [inline] ffff8880b873aab0 (batched_entropy_u8.lock){..-.}-{3:3}, at: get_random_u8+0x1a0/0xaa0 drivers/char/random.c:551 other info that might help us debug this: context-{2:2} 3 locks held by syz.1.68/6089: #0: ffff8880319781e0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline] #0: ffff8880319781e0 (&mm->mmap_lock){++++}-{4:4}, at: exit_mmap+0x165/0xc20 mm/mmap.c:1656 #1: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #1: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #1: ffffffff8e937ae0 (rcu_read_lock){....}-{1:3}, at: ___pte_offset_map+0x82/0x380 mm/pgtable-generic.c:287 #2: ffff888051582af8 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff888051582af8 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: __pte_offset_map_lock+0x1ba/0x300 mm/pgtable-generic.c:402 stack backtrace: CPU: 1 UID: 0 PID: 6089 Comm: syz.1.68 Not tainted 6.13.0-rc7-syzkaller-00019-gc45323b7560e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_lock_invalid_wait_context kernel/locking/lockdep.c:4826 [inline] check_wait_context kernel/locking/lockdep.c:4898 [inline] __lock_acquire+0x15a8/0x2100 kernel/locking/lockdep.c:5176 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 local_lock_acquire include/linux/local_lock_internal.h:29 [inline] get_random_u8+0x1bd/0xaa0 drivers/char/random.c:551 get_random_u32_below include/linux/random.h:78 [inline] kfence_guarded_alloc+0x9c/0xcd0 mm/kfence/core.c:421 __kfence_alloc+0x344/0x370 mm/kfence/core.c:1136 kfence_alloc include/linux/kfence.h:129 [inline] slab_alloc_node mm/slub.c:4152 [inline] __kmalloc_cache_noprof+0x2dd/0x390 mm/slub.c:4324 kmalloc_noprof include/linux/slab.h:901 [inline] add_stack_record_to_list mm/page_owner.c:172 [inline] inc_stack_record_count mm/page_owner.c:214 [inline] __set_page_owner+0x55f/0x800 mm/page_owner.c:329 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269 stack_depot_save_flags+0x72d/0x940 lib/stackdepot.c:627 kasan_save_stack+0x4f/0x60 mm/kasan/common.c:48 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:544 task_work_add+0xd9/0x490 kernel/task_work.c:77 __run_posix_cpu_timers kernel/time/posix-cpu-timers.c:1223 [inline] run_posix_cpu_timers+0x6ac/0x810 kernel/time/posix-cpu-timers.c:1422 tick_sched_handle kernel/time/tick-sched.c:276 [inline] tick_nohz_handler+0x37c/0x500 kernel/time/tick-sched.c:297 __run_hrtimer kernel/time/hrtimer.c:1739 [inline] __hrtimer_run_queues+0x551/0xd30 kernel/time/hrtimer.c:1803 hrtimer_interrupt+0x403/0xa40 kernel/time/hrtimer.c:1865 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline] __sysvec_apic_timer_interrupt+0x110/0x420 arch/x86/kernel/apic/apic.c:1055 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:lockdep_enabled kernel/locking/lockdep.c:122 [inline] RIP: 0010:lock_acquire+0x144/0x550 kernel/locking/lockdep.c:5825 Code: 8b 05 00 ca 87 7e 85 c0 0f 85 8f 01 00 00 65 48 8b 1c 25 00 d6 03 00 48 81 c3 dc 0a 00 00 48 89 d8 48 c1 e8 03 42 0f b6 04 28 <84> c0 0f 85 e5 02 00 00 83 3b 00 0f 85 62 01 00 00 4c 8d bc 24 80 RSP: 0018:ffffc9000b45f0c0 EFLAGS: 00000a03 RAX: 0000000000000000 RBX: ffff88802f7ae4dc RCX: ffffffff817ac034 RDX: 0000000000000000 RSI: ffffffff8c5fb200 RDI: ffffffff8c5fb1c0 RBP: ffffc9000b45f218 R08: ffffffff901983b7 R09: 1ffffffff2033076 R10: dffffc0000000000 R11: fffffbfff2033077 R12: 1ffff9200168be20 R13: dffffc0000000000 R14: 0000000000000000 R15: ffffea0001890040 rcu_lock_acquire include/linux/rcupdate.h:337 [inline] rcu_read_lock include/linux/rcupdate.h:849 [inline] page_ext_get+0x3d/0x2a0 mm/page_ext.c:525 page_table_check_clear+0x4b/0x550 mm/page_table_check.c:74 get_and_clear_full_ptes include/linux/pgtable.h:705 [inline] zap_present_folio_ptes mm/memory.c:1502 [inline] zap_present_ptes mm/memory.c:1585 [inline] zap_pte_range mm/memory.c:1627 [inline] zap_pmd_range mm/memory.c:1753 [inline] zap_pud_range mm/memory.c:1782 [inline] zap_p4d_range mm/memory.c:1803 [inline] unmap_page_range+0x2c2e/0x4040 mm/memory.c:1824 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1914 exit_mmap+0x275/0xc20 mm/mmap.c:1672 __mmput+0x115/0x3c0 kernel/fork.c:1348 exit_mm+0x220/0x310 kernel/exit.c:570 do_exit+0x9ad/0x28e0 kernel/exit.c:925 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 get_signal+0x16b2/0x1750 kernel/signal.c:3017 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xce/0x340 kernel/entry/common.c:218 __do_fast_syscall_32+0xc4/0x110 arch/x86/entry/common.c:389 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7f05579 Code: Unable to access opcode bytes at 0xf7f0554f. RSP: 002b:00000000f503560c EFLAGS: 00000206 ORIG_RAX: 00000000000000f0 RAX: fffffffffffffe00 RBX: 00000000f73c5018 RCX: 0000000000000080 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000f73c501c RBP: 0000000000000081 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess): 0: 8b 05 00 ca 87 7e mov 0x7e87ca00(%rip),%eax # 0x7e87ca06 6: 85 c0 test %eax,%eax 8: 0f 85 8f 01 00 00 jne 0x19d e: 65 48 8b 1c 25 00 d6 mov %gs:0x3d600,%rbx 15: 03 00 17: 48 81 c3 dc 0a 00 00 add $0xadc,%rbx 1e: 48 89 d8 mov %rbx,%rax 21: 48 c1 e8 03 shr $0x3,%rax 25: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax * 2a: 84 c0 test %al,%al <-- trapping instruction 2c: 0f 85 e5 02 00 00 jne 0x317 32: 83 3b 00 cmpl $0x0,(%rbx) 35: 0f 85 62 01 00 00 jne 0x19d 3b: 4c rex.WR 3c: 8d .byte 0x8d 3d: bc .byte 0xbc 3e: 24 80 and $0x80,%al