syzbot


WARNING: locking bug in run_posix_cpu_timers

Status: upstream: reported on 2025/01/19 17:06
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+a39472aa740094f6347f@syzkaller.appspotmail.com
First crash: 5d06h, last: 5d06h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] WARNING: locking bug in run_posix_cpu_timers 0 (1) 2025/01/19 17:06

Sample crash report:
[ BUG: Invalid wait context ]
-----------------------------
ffffffff8e3a43f8 (stack_list_lock){-.-.}-{3:3}, at: add_stack_record_to_list mm/page_owner.c:182 [inline]
ffffffff8e3a43f8 (stack_list_lock){-.-.}-{3:3}, at: inc_stack_record_count mm/page_owner.c:214 [inline]
ffffffff8e3a43f8 (stack_list_lock){-.-.}-{3:3}, at: __set_page_owner+0x3ea/0x560 mm/page_owner.c:329
other info that might help us debug this:
context-{2:2}
 #0: ffff8880325bb2a0 (&mm->mmap_lock){++++}-{4:4}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline]
 #0: ffff8880325bb2a0 (&mm->mmap_lock){++++}-{4:4}, at: exit_mmap+0x10c/0xb20 mm/mmap.c:1656
 #2: ffff88802a519918 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline]
 #2: ffff88802a519918 (ptlock_ptr(ptdesc)#2){+.+.}-{3:3}, at: __pte_offset_map_lock+0xf1/0x300 mm/pgtable-generic.c:402
 #3: ffffffff8e1bb840 (rcu_read_lock_sched){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #3: ffffffff8e1bb840 (rcu_read_lock_sched){....}-{1:2}, at: rcu_read_lock_sched include/linux/rcupdate.h:941 [inline]
 #3: ffffffff8e1bb840 (rcu_read_lock_sched){....}-{1:2}, at: pfn_valid include/linux/mmzone.h:2048 [inline]
 #3: ffffffff8e1bb840 (rcu_read_lock_sched){....}-{1:2}, at: page_table_check_clear mm/page_table_check.c:70 [inline]
 #3: ffffffff8e1bb840 (rcu_read_lock_sched){....}-{1:2}, at: __page_table_check_pte_clear+0x1ba/0x580 mm/page_table_check.c:169
CPU: 0 UID: 0 PID: 7575 Comm: syz.0.628 Not tainted 6.13.0-rc7-syzkaller-00043-g619f0b6fad52 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Call Trace:
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4753
 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48
 __kasan_record_aux_stack+0xba/0xd0 mm/kasan/generic.c:544
 __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
 __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
 </IRQ>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:lock_acquire.part.0+0x155/0x380 kernel/locking/lockdep.c:5814
Code: b8 ff ff ff ff 65 0f c1 05 40 b0 8b 7e 83 f8 01 0f 85 d0 01 00 00 9c 58 f6 c4 02 0f 85 e5 01 00 00 48 85 ed 0f 85 b6 01 00 00 <48> b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7 03 00 00 00 00 48 c7
RSP: 0018:ffffc90010a87710 EFLAGS: 00000206
RAX: 0000000000000046 RBX: 1ffff92002150ee3 RCX: 00000000a9f140cb
RDX: 0000000000000001 RSI: ffffffff8b6cdce0 RDI: ffffffff8bd1ef20
RBP: 0000000000000200 R08: 0000000000000000 R09: fffffbfff2dca798
R10: ffffffff96e53cc7 R11: 0000000000000003 R12: 0000000000000000
 rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 rcu_read_lock_sched include/linux/rcupdate.h:941 [inline]
 pfn_valid include/linux/mmzone.h:2048 [inline]
 page_table_check_clear mm/page_table_check.c:70 [inline]
 __page_table_check_pte_clear+0x1c0/0x580 mm/page_table_check.c:169
 page_table_check_pte_clear include/linux/page_table_check.h:49 [inline]
 ptep_get_and_clear_full arch/x86/include/asm/pgtable.h:1337 [inline]
 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+0x22f6/0x3d10 mm/memory.c:1824
 unmap_single_vma+0x194/0x2b0 mm/memory.c:1870
 exit_mmap+0x1c6/0xb20 mm/mmap.c:1672
 __mmput+0x12a/0x4c0 kernel/fork.c:1348
 exit_mm kernel/exit.c:570 [inline]
 do_exit+0x9ba/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
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
RIP: 0033:0x7fd902b85d29
----------------
Code disassembly (best guess):
   0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
   5:	65 0f c1 05 40 b0 8b 	xadd   %eax,%gs:0x7e8bb040(%rip)        # 0x7e8bb04d
   c:	7e
   d:	83 f8 01             	cmp    $0x1,%eax
  10:	0f 85 d0 01 00 00    	jne    0x1e6
  16:	9c                   	pushf
  17:	58                   	pop    %rax
  18:	f6 c4 02             	test   $0x2,%ah
  1b:	0f 85 e5 01 00 00    	jne    0x206
  21:	48 85 ed             	test   %rbp,%rbp
  24:	0f 85 b6 01 00 00    	jne    0x1e0
* 2a:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax <-- trapping instruction
  31:	fc ff df
  34:	48 01 c3             	add    %rax,%rbx
  37:	48 c7 03 00 00 00 00 	movq   $0x0,(%rbx)
  3e:	48                   	rex.W
  3f:	c7                   	.byte 0xc7

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/15 17:02 upstream 619f0b6fad52 7315a7cf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING: locking bug in run_posix_cpu_timers
* Struck through repros no longer work on HEAD.