syzbot


KASAN: global-out-of-bounds Read in pvclock_gtod_notify

Status: auto-closed as invalid on 2020/11/11 07:48
Subsystems: kvm
[Documentation on labels]
Reported-by: syzbot+916e9f1b8faca356f20b@syzkaller.appspotmail.com
First crash: 1324d, last: 1324d

Sample crash report:
==================================================================
BUG: KASAN: global-out-of-bounds in update_pvclock_gtod arch/x86/kvm/x86.c:1745 [inline]
BUG: KASAN: global-out-of-bounds in pvclock_gtod_notify+0x522/0x570 arch/x86/kvm/x86.c:7452
Read of size 8 at addr ffffffff8c96d2c0 by task syz-executor.3/12844

CPU: 1 PID: 12844 Comm: syz-executor.3 Not tainted 5.8.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0x5/0x497 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 update_pvclock_gtod arch/x86/kvm/x86.c:1745 [inline]
 pvclock_gtod_notify+0x522/0x570 arch/x86/kvm/x86.c:7452
 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83
 update_pvclock_gtod kernel/time/timekeeping.c:581 [inline]
 timekeeping_update+0x28a/0x4a0 kernel/time/timekeeping.c:675
 timekeeping_advance+0x6ad/0xa40 kernel/time/timekeeping.c:2122
 tick_do_update_jiffies64.part.0+0x1ec/0x330 kernel/time/tick-sched.c:101
 tick_do_update_jiffies64 kernel/time/tick-sched.c:64 [inline]
 tick_sched_do_timer kernel/time/tick-sched.c:147 [inline]
 tick_sched_timer+0x236/0x2a0 kernel/time/tick-sched.c:1321
 __run_hrtimer kernel/time/hrtimer.c:1524 [inline]
 __hrtimer_run_queues+0x1d5/0xfc0 kernel/time/hrtimer.c:1588
 hrtimer_interrupt+0x32a/0x930 kernel/time/hrtimer.c:1650
 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1080 [inline]
 __sysvec_apic_timer_interrupt+0x142/0x5e0 arch/x86/kernel/apic/apic.c:1097
 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:706
 </IRQ>
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline]
 sysvec_apic_timer_interrupt+0xb2/0xf0 arch/x86/kernel/apic/apic.c:1091
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:581
RIP: 0010:arch_atomic_dec_and_test arch/x86/include/asm/atomic.h:123 [inline]
RIP: 0010:atomic_dec_and_test include/asm-generic/atomic-instrumented.h:749 [inline]
RIP: 0010:page_ref_dec_and_test include/linux/page_ref.h:148 [inline]
RIP: 0010:put_page_testzero include/linux/mm.h:696 [inline]
RIP: 0010:release_pages+0x1cf/0x17a0 mm/swap.c:871
Code: 65 34 31 ff 44 89 e6 e8 df 77 db ff 45 85 e4 0f 84 db 05 00 00 e8 51 7b db ff be 04 00 00 00 48 89 df e8 b4 3c 1b 00 f0 ff 0b <0f> 94 c3 31 ff 89 de e8 75 77 db ff 84 db 0f 84 fd 02 00 00 e8 28
RSP: 0018:ffffc9000876f8f0 EFLAGS: 00000206
RAX: 0000000000000001 RBX: ffffea00016f83b4 RCX: ffffffff8198ce4c
RDX: fffff940002df077 RSI: 0000000000000004 RDI: ffffea00016f83b4
RBP: 0000000000000132 R08: 0000000000000001 R09: ffffea00016f83b7
R10: fffff940002df076 R11: 0000000000000000 R12: 0000000000000004
R13: ffffea00016f8380 R14: ffff8880a7e369a8 R15: dffffc0000000000
 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:242 [inline]
 tlb_flush_mmu mm/mmu_gather.c:249 [inline]
 tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:328
 exit_mmap+0x2d1/0x530 mm/mmap.c:3185
 __mmput+0x122/0x470 kernel/fork.c:1076
 mmput+0x53/0x60 kernel/fork.c:1097
 exit_mm kernel/exit.c:483 [inline]
 do_exit+0xa8b/0x29f0 kernel/exit.c:793
 do_group_exit+0x125/0x310 kernel/exit.c:903
 get_signal+0x40b/0x1ee0 kernel/signal.c:2743
 arch_do_signal+0x82/0x2520 arch/x86/kernel/signal.c:811
 exit_to_user_mode_loop kernel/entry/common.c:135 [inline]
 exit_to_user_mode_prepare+0x172/0x1d0 kernel/entry/common.c:166
 syscall_exit_to_user_mode+0x59/0x2b0 kernel/entry/common.c:241
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45d189
Code: Bad RIP value.
RSP: 002b:00007f9261371c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: 0000000000000018 RBX: 000000000002bf80 RCX: 000000000045d189
RDX: 0000000000000000 RSI: 0000000020005680 RDI: 0000000000000005
RBP: 000000000118d020 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cfec
R13: 00007ffe7d3bf86f R14: 00007f92613729c0 R15: 000000000118cfec

The buggy address belongs to the variable:
 no_irq_affinity+0x20/0x40

Memory state around the buggy address:
 ffffffff8c96d180: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
 ffffffff8c96d200: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
>ffffffff8c96d280: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
                                           ^
 ffffffff8c96d300: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 f9 f9
 ffffffff8c96d380: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 f9 f9
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/13 07:47 upstream fb893de323e2 bc15f7db .config console log report ci-upstream-kasan-gce-selinux-root
* Struck through repros no longer work on HEAD.