syzbot


KASAN: use-after-free Write in paging64_update_accessed_dirty_bits (2)

Status: auto-closed as invalid on 2022/01/27 12:44
Reported-by: syzbot+e32294b8ad915bc6aa02@syzkaller.appspotmail.com
First crash: 1151d, last: 1151d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Write in paging64_update_accessed_dirty_bits C error 16 1004d 1112d 2/2 fixed on 2022/04/21 04:24
android-54 KASAN: use-after-free Write in paging64_update_accessed_dirty_bits 1 1299d 1299d 0/2 auto-closed as invalid on 2021/09/01 08:03

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in paging64_cmpxchg_gpte arch/x86/kvm/paging_tmpl.h:166 [inline]
BUG: KASAN: use-after-free in paging64_update_accessed_dirty_bits+0x5b9/0x9d0 arch/x86/kvm/paging_tmpl.h:272
Write of size 8 at addr ffff888010001000 by task syz-executor.3/5743

CPU: 0 PID: 5743 Comm: syz-executor.3 Not tainted 5.4.125-syzkaller-00028-gd5fa5fb1ccb2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d8/0x24e lib/dump_stack.c:118
 print_address_description+0x9b/0x650 mm/kasan/report.c:384
 __kasan_report+0x182/0x260 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 check_memory_region_inline mm/kasan/generic.c:141 [inline]
 check_memory_region+0x2a5/0x2e0 mm/kasan/generic.c:191
 paging64_cmpxchg_gpte arch/x86/kvm/paging_tmpl.h:166 [inline]
 paging64_update_accessed_dirty_bits+0x5b9/0x9d0 arch/x86/kvm/paging_tmpl.h:272
 paging64_walk_addr_generic+0xd6d/0x16d0 arch/x86/kvm/paging_tmpl.h:445
 paging64_walk_addr arch/x86/kvm/paging_tmpl.h:502 [inline]
 paging64_gva_to_gpa+0xd0/0x1a0 arch/x86/kvm/paging_tmpl.h:957
 kvm_mmu_gva_to_gpa_write arch/x86/kvm/x86.c:5395 [inline]
 emulator_cmpxchg_emulated+0x1b5/0x7c0 arch/x86/kvm/x86.c:5865
 __load_segment_descriptor+0xe1c/0x1560 arch/x86/kvm/emulate.c:1763
 x86_emulate_insn+0x1037/0x6200 arch/x86/kvm/emulate.c:5718
 x86_emulate_instruction+0xc6b/0x2a30 arch/x86/kvm/x86.c:6810
 vcpu_enter_guest+0x28c2/0x3ea0 arch/x86/kvm/x86.c:8349
 vcpu_run+0x344/0xc00 arch/x86/kvm/x86.c:8413
 kvm_arch_vcpu_ioctl_run+0x463/0x950 arch/x86/kvm/x86.c:8635
 kvm_vcpu_ioctl+0x812/0xdc0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2930
 do_vfs_ioctl+0x76a/0x1720 fs/ioctl.c:47
 ksys_ioctl fs/ioctl.c:742 [inline]
 __do_sys_ioctl fs/ioctl.c:749 [inline]
 __se_sys_ioctl fs/ioctl.c:747 [inline]
 __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747
 do_syscall_64+0xcb/0x1e0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7f5525386709
Code: ff ff c3 66 2e 0f 1f 84 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 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f55230dd188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f552548b020 RCX: 00007f5525386709
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000006
RBP: 00007f55253e0cb4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffdd3da518f R14: 00007f55230dd300 R15: 0000000000022000

The buggy address belongs to the page:
page:ffffea0000400040 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x4000000000000000()
raw: 4000000000000000 ffffea0000400048 ffffea0000400048 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner info is not present (never set?)

Memory state around the buggy address:
 ffff888010000f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888010000f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888010001000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888010001080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888010001100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/09/29 12:43 android12-5.4 d5fa5fb1ccb2 e08fe937 .config console log report info ci2-android-5-4-kasan KASAN: use-after-free Write in paging64_update_accessed_dirty_bits
* Struck through repros no longer work on HEAD.