=============================
[ BUG: Invalid wait context ]
6.12.0-next-20241118-syzkaller #0 Not tainted
-----------------------------
syz.5.1588/12129 is trying to lock:
ffffffff8ea6a918 (stack_list_lock){-.-.}-{3:3}, at: add_stack_record_to_list mm/page_owner.c:182 [inline]
ffffffff8ea6a918 (stack_list_lock){-.-.}-{3:3}, at: inc_stack_record_count mm/page_owner.c:214 [inline]
ffffffff8ea6a918 (stack_list_lock){-.-.}-{3:3}, at: __set_page_owner+0x5cb/0x800 mm/page_owner.c:329
other info that might help us debug this:
context-{2:2}
2 locks held by syz.5.1588/12129:
#0: ffff888076fa6420 (sb_writers#5){.+.+}-{0:0}, at: do_coredump+0x2110/0x2e60 fs/coredump.c:757
#1: ffff8880620d1660 (&sb->s_type->i_mutex_key#12){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline]
#1: ffff8880620d1660 (&sb->s_type->i_mutex_key#12){+.+.}-{4:4}, at: shmem_file_write_iter+0x80/0x120 mm/shmem.c:3283
stack backtrace:
CPU: 0 UID: 0 PID: 12129 Comm: syz.5.1588 Not tainted 6.12.0-next-20241118-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/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
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
add_stack_record_to_list mm/page_owner.c:182 [inline]
inc_stack_record_count mm/page_owner.c:214 [inline]
__set_page_owner+0x5cb/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:1556
prep_new_page mm/page_alloc.c:1564 [inline]
get_page_from_freelist+0x3725/0x3870 mm/page_alloc.c:3510
__alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4787
alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265
stack_depot_save_flags+0x666/0x830 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/0xd50 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:bytes_is_nonzero mm/kasan/generic.c:89 [inline]
RIP: 0010:memory_is_nonzero mm/kasan/generic.c:104 [inline]
RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:129 [inline]
RIP: 0010:memory_is_poisoned mm/kasan/generic.c:161 [inline]
RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline]
RIP: 0010:kasan_check_range+0x8c/0x290 mm/kasan/generic.c:189
Code: 3c 31 4c 89 fd 4c 29 dd 48 83 fd 10 7f 29 48 85 ed 0f 84 3e 01 00 00 4c 89 cd 48 f7 d5 48 01 dd 41 80 3b 00 0f 85 c9 01 00 00 <49> ff c3 48 ff c5 75 ee e9 1e 01 00 00 45 89 dc 41 83 e4 07 0f 84
RSP: 0000:ffffc90003f66af0 EFLAGS: 00000246
RAX: ffffea00016f5d01 RBX: 1ffffd40002deba6 RCX: ffffffff81dc8954
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffea00016f5d34
RBP: ffffffffffffffff R08: ffffea00016f5d37 R09: 1ffffd40002deba6
R10: dffffc0000000000 R11: fffff940002deba6 R12: dffffc0000000000
R13: ffff8880620d1548 R14: dffffc0000000001 R15: fffff940002deba7
instrument_atomic_read include/linux/instrumented.h:68 [inline]
atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
page_ref_count include/linux/page_ref.h:67 [inline]
folio_ref_count include/linux/page_ref.h:89 [inline]
folio_get include/linux/mm.h:1454 [inline]
__folio_batch_add_and_move+0x144/0xf00 mm/swap.c:187
shmem_alloc_and_add_folio+0xdd6/0x13d0 mm/shmem.c:1892
shmem_get_folio_gfp+0x5a9/0x20a0 mm/shmem.c:2355
shmem_get_folio mm/shmem.c:2461 [inline]
shmem_write_begin+0x17e/0x460 mm/shmem.c:3117
generic_perform_write+0x344/0x6d0 mm/filemap.c:4055
shmem_file_write_iter+0xf9/0x120 mm/shmem.c:3293
__kernel_write_iter+0x42a/0x940 fs/read_write.c:612
dump_emit_page fs/coredump.c:884 [inline]
dump_user_range+0x4f1/0x970 fs/coredump.c:945
elf_core_dump+0x3e9f/0x4790 fs/binfmt_elf.c:2127
do_coredump+0x214b/0x2e60 fs/coredump.c:758
get_signal+0x140b/0x1750 kernel/signal.c:2995
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]
irqentry_exit_to_user_mode+0x7e/0x250 kernel/entry/common.c:231
exc_page_fault+0x590/0x8c0 arch/x86/mm/fault.c:1542
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0033:0x7f61b837e761
Code: 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 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f
RSP: 002b:00000000fffffe10 EFLAGS: 00010217
RAX: 0000000000000000 RBX: 00007f61b8536058 RCX: 00007f61b837e759
RDX: 0000000000000000 RSI: 00000000fffffe10 RDI: 0000000000000000
RBP: 00007f61b83f175e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f61b8536058 R15: 00007ffd19d9fc18
----------------
Code disassembly (best guess):
0: 3c 31 cmp $0x31,%al
2: 4c 89 fd mov %r15,%rbp
5: 4c 29 dd sub %r11,%rbp
8: 48 83 fd 10 cmp $0x10,%rbp
c: 7f 29 jg 0x37
e: 48 85 ed test %rbp,%rbp
11: 0f 84 3e 01 00 00 je 0x155
17: 4c 89 cd mov %r9,%rbp
1a: 48 f7 d5 not %rbp
1d: 48 01 dd add %rbx,%rbp
20: 41 80 3b 00 cmpb $0x0,(%r11)
24: 0f 85 c9 01 00 00 jne 0x1f3
* 2a: 49 ff c3 inc %r11 <-- trapping instruction
2d: 48 ff c5 inc %rbp
30: 75 ee jne 0x20
32: e9 1e 01 00 00 jmp 0x155
37: 45 89 dc mov %r11d,%r12d
3a: 41 83 e4 07 and $0x7,%r12d
3e: 0f .byte 0xf
3f: 84 .byte 0x84