syzbot


upstream test error: WARNING: locking bug in __rmqueue_pcplist

Status: upstream: reported on 2024/12/07 17:47
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+4dbab151c88eb889644b@syzkaller.appspotmail.com
First crash: 22d, last: 14d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] upstream test error: WARNING: locking bug in __rmqueue_pcplist 0 (1) 2024/12/07 17:47

Sample crash report:
=============================
[ BUG: Invalid wait context ]
6.13.0-rc2-syzkaller-00036-g231825b2e1ff #0 Not tainted
-----------------------------
syz.0.114/5948 is trying to lock:
ffff88813fffc298 (&zone->lock){-.-.}-{3:3}, at: rmqueue_bulk mm/page_alloc.c:2307 [inline]
ffff88813fffc298 (&zone->lock){-.-.}-{3:3}, at: __rmqueue_pcplist+0x6bb/0x1600 mm/page_alloc.c:3001
other info that might help us debug this:
context-{2:2}
4 locks held by syz.0.114/5948:
 #0: ffff88807df01f20 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline]
 #0: ffff88807df01f20 (&mm->mmap_lock){++++}-{4:4}, at: exit_mmap+0x10c/0xb20 mm/mmap.c:1652
 #1: ffffffff8ddba940 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #1: ffffffff8ddba940 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #1: ffffffff8ddba940 (rcu_read_lock){....}-{1:3}, at: __pte_offset_map+0x42/0x540 mm/pgtable-generic.c:287
 #2: ffff888028da3d98 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #2: ffff888028da3d98 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: __pte_offset_map_lock+0xf1/0x300 mm/pgtable-generic.c:402
 #3: ffff8880b8744d98 (&pcp->lock){+.+.}-{3:3}, at: spin_trylock include/linux/spinlock.h:361 [inline]
 #3: ffff8880b8744d98 (&pcp->lock){+.+.}-{3:3}, at: rmqueue_pcplist mm/page_alloc.c:3030 [inline]
 #3: ffff8880b8744d98 (&pcp->lock){+.+.}-{3:3}, at: rmqueue mm/page_alloc.c:3074 [inline]
 #3: ffff8880b8744d98 (&pcp->lock){+.+.}-{3:3}, at: get_page_from_freelist+0x350/0x2f80 mm/page_alloc.c:3471
stack backtrace:
CPU: 1 UID: 0 PID: 5948 Comm: syz.0.114 Not tainted 6.13.0-rc2-syzkaller-00036-g231825b2e1ff #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 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+0x878/0x3c40 kernel/locking/lockdep.c:5176
 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162
 rmqueue_bulk mm/page_alloc.c:2307 [inline]
 __rmqueue_pcplist+0x6bb/0x1600 mm/page_alloc.c:3001
 rmqueue_pcplist mm/page_alloc.c:3043 [inline]
 rmqueue mm/page_alloc.c:3074 [inline]
 get_page_from_freelist+0x3d2/0x2f80 mm/page_alloc.c:3471
 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751
 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2269
 stack_depot_save_flags+0x8e0/0x9e0 lib/stackdepot.c:627
 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48
 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:544
 task_work_add+0xc0/0x3b0 kernel/task_work.c:77
 __run_posix_cpu_timers kernel/time/posix-cpu-timers.c:1223 [inline]
 run_posix_cpu_timers+0x69f/0x7d0 kernel/time/posix-cpu-timers.c:1422
 update_process_times+0x1a1/0x2d0 kernel/time/timer.c:2526
 tick_sched_handle kernel/time/tick-sched.c:276 [inline]
 tick_nohz_handler+0x376/0x530 kernel/time/tick-sched.c:297
 __run_hrtimer kernel/time/hrtimer.c:1739 [inline]
 __hrtimer_run_queues+0x5fb/0xae0 kernel/time/hrtimer.c:1803
 hrtimer_interrupt+0x392/0x8e0 kernel/time/hrtimer.c:1865
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1038 [inline]
 __sysvec_apic_timer_interrupt+0x10f/0x400 arch/x86/kernel/apic/apic.c:1055
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline]
 sysvec_apic_timer_interrupt+0x9f/0xc0 arch/x86/kernel/apic/apic.c:1049
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:preempt_count arch/x86/include/asm/preempt.h:26 [inline]
RIP: 0010:check_kcov_mode kernel/kcov.c:183 [inline]
RIP: 0010:write_comp_data+0x11/0x90 kernel/kcov.c:246
Code: cc cc cc cc 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 49 89 d2 49 89 f8 49 89 f1 65 48 8b 15 bf 9b 6a 7e <65> 8b 05 c0 9b 6a 7e a9 00 01 ff 00 74 1d f6 c4 01 74 67 a9 00 00
RSP: 0018:ffffc9000433f888 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff81e2c81a
RDX: ffff88807b435a00 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 0000000000000002 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000003 R12: dffffc0000000000
R13: 00007fa58e0b5000 R14: ffffea0001d88a80 R15: ffffc9000433fcc8
 zap_present_folio_ptes mm/memory.c:1528 [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+0x1a0a/0x3d40 mm/memory.c:1824
 unmap_single_vma+0x194/0x2b0 mm/memory.c:1870
 unmap_vmas+0x22f/0x490 mm/memory.c:1914
 exit_mmap+0x1c6/0xb20 mm/mmap.c:1668
 __mmput+0x12a/0x4c0 kernel/fork.c:1353
 mmput+0x62/0x70 kernel/fork.c:1375
 exit_mm kernel/exit.c:570 [inline]
 do_exit+0x9bf/0x2d70 kernel/exit.c:925
 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087
 __do_sys_exit_group kernel/exit.c:1098 [inline]
 __se_sys_exit_group kernel/exit.c:1096 [inline]
 __x64_sys_exit_group+0x3e/0x50 kernel/exit.c:1096
 x64_sys_call+0x151f/0x1720 arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa58df85d19
Code: Unable to access opcode bytes at 0x7fa58df85cef.
RSP: 002b:00007ffd067f71d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fa58df85d19
RDX: ffffffffffffffff RSI: ffffffffffffffff RDI: 0000000000000000
RBP: 00007ffd067f722c R08: 0000000000000001 R09: 000000000000ffe8
R10: 00007fa58de00000 R11: 0000000000000246 R12: 0000000000000032
R13: 000000000000ffe8 R14: 00007ffd067f7280 R15: 00007ffd067f7280
 </TASK>
----------------
Code disassembly (best guess):
   0:	cc                   	int3
   1:	cc                   	int3
   2:	cc                   	int3
   3:	cc                   	int3
   4:	0f 1f 44 00 00       	nopl   0x0(%rax,%rax,1)
   9:	90                   	nop
   a:	90                   	nop
   b:	90                   	nop
   c:	90                   	nop
   d:	90                   	nop
   e:	90                   	nop
   f:	90                   	nop
  10:	90                   	nop
  11:	90                   	nop
  12:	90                   	nop
  13:	90                   	nop
  14:	90                   	nop
  15:	90                   	nop
  16:	90                   	nop
  17:	90                   	nop
  18:	90                   	nop
  19:	49 89 d2             	mov    %rdx,%r10
  1c:	49 89 f8             	mov    %rdi,%r8
  1f:	49 89 f1             	mov    %rsi,%r9
  22:	65 48 8b 15 bf 9b 6a 	mov    %gs:0x7e6a9bbf(%rip),%rdx        # 0x7e6a9be9
  29:	7e
* 2a:	65 8b 05 c0 9b 6a 7e 	mov    %gs:0x7e6a9bc0(%rip),%eax        # 0x7e6a9bf1 <-- trapping instruction
  31:	a9 00 01 ff 00       	test   $0xff0100,%eax
  36:	74 1d                	je     0x55
  38:	f6 c4 01             	test   $0x1,%ah
  3b:	74 67                	je     0xa4
  3d:	a9                   	.byte 0xa9

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/11 23:02 upstream 231825b2e1ff 6f1b0fa8 .config console log report [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto upstream test error: WARNING: locking bug in __rmqueue_pcplist
2024/12/03 17:37 upstream ceb8bf2ceaa7 d4480042 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-arm64-compat upstream test error: WARNING: locking bug in __rmqueue_pcplist
* Struck through repros no longer work on HEAD.