syzbot


KASAN: use-after-free Write in paging32_walk_addr_generic

Status: auto-obsoleted due to no activity on 2022/09/27 05:06
Reported-by: syzbot+47665dbce263479409c8@syzkaller.appspotmail.com
First crash: 772d, last: 678d

Cause bisection: introduced by (bisect log) [merge commit]:
commit 7ba31c3f2f1ee095d8126f4d3757fc3b2bc3c838
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Wed Jan 29 18:15:11 2020 +0000

  Merge tag 'staging-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Crash: INFO: rcu detected stall in kvm_vcpu_ioctl (log)
Repro: C syz .config

Fix bisection: failed (bisect log)
Patch testing requests:
Created Duration User Patch Repo Result
2022/09/27 03:30 16m linux-next OK log
2022/09/26 02:30 16m upstream OK log
2022/09/25 23:30 15m upstream OK log
2022/09/23 13:30 16m upstream OK log
2022/09/21 14:29 17m upstream OK log

Sample crash report:
L1TF CPU bug present and SMT on, data leak possible. See CVE-2018-3646 and https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/l1tf.html for details.
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:71 [inline]
BUG: KASAN: use-after-free in paging32_cmpxchg_gpte arch/x86/kvm/mmu/paging_tmpl.h:181 [inline]
BUG: KASAN: use-after-free in paging32_update_accessed_dirty_bits arch/x86/kvm/mmu/paging_tmpl.h:287 [inline]
BUG: KASAN: use-after-free in paging32_walk_addr_generic+0x155d/0x1980 arch/x86/kvm/mmu/paging_tmpl.h:457
Write of size 4 at addr ffff888000105000 by task syz-executor711/6845

CPU: 1 PID: 6845 Comm: syz-executor711 Not tainted 5.9.0-rc1-syzkaller #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+0x18f/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
 check_memory_region_inline mm/kasan/generic.c:186 [inline]
 check_memory_region+0x13d/0x180 mm/kasan/generic.c:192
 instrument_atomic_write include/linux/instrumented.h:71 [inline]
 paging32_cmpxchg_gpte arch/x86/kvm/mmu/paging_tmpl.h:181 [inline]
 paging32_update_accessed_dirty_bits arch/x86/kvm/mmu/paging_tmpl.h:287 [inline]
 paging32_walk_addr_generic+0x155d/0x1980 arch/x86/kvm/mmu/paging_tmpl.h:457
 paging32_walk_addr arch/x86/kvm/mmu/paging_tmpl.h:514 [inline]
 paging32_gva_to_gpa+0xb2/0x1d0 arch/x86/kvm/mmu/paging_tmpl.h:958
 vcpu_mmio_gva_to_gpa arch/x86/kvm/x86.c:5758 [inline]
 emulator_read_write_onepage+0x2f3/0xa70 arch/x86/kvm/x86.c:5874
 emulator_read_write+0x1c4/0x5a0 arch/x86/kvm/x86.c:5934
 emulator_write_emulated arch/x86/kvm/x86.c:5971 [inline]
 emulator_fix_hypercall+0x132/0x190 arch/x86/kvm/x86.c:7763
 em_hypercall+0x5d/0x130 arch/x86/kvm/emulate.c:3803
 x86_emulate_insn+0x5e8/0x3d20 arch/x86/kvm/emulate.c:5676
 x86_emulate_instruction+0x752/0x1e00 arch/x86/kvm/x86.c:7017
 kvm_emulate_instruction arch/x86/kvm/x86.c:7085 [inline]
 handle_ud+0xa8/0x240 arch/x86/kvm/x86.c:5718
 handle_exception_nmi+0xaf7/0x1270 arch/x86/kvm/vmx/vmx.c:4761
 vmx_handle_exit+0x293/0x14c0 arch/x86/kvm/vmx/vmx.c:6118
 vcpu_enter_guest+0x14d6/0x3b60 arch/x86/kvm/x86.c:8641
 vcpu_run arch/x86/kvm/x86.c:8706 [inline]
 kvm_arch_vcpu_ioctl_run+0x440/0x1780 arch/x86/kvm/x86.c:8923
 kvm_vcpu_ioctl+0x467/0xdf0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3229
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x443639
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 9b 0b fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffeb5160548 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffeb5160550 RCX: 0000000000443639
RDX: 0000000000000000 RSI: 000000000000ae80 RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000000 R09: 00000000004011b0
R10: 0000000000000012 R11: 0000000000000246 R12: 0000000000404660
R13: 00000000004046f0 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000e4efb04a refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105
flags: 0x7ffe0000000000()
raw: 007ffe0000000000 ffffea0000004148 ffffea0000004148 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888000104f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888000104f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888000105000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888000105080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888000105100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (6):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2020/08/18 10:22 upstream 06a4ec1d9dc6 424dd8e7 .config log report syz C
ci-upstream-kasan-gce-selinux-root 2020/08/17 12:17 upstream 9123e3a74ec7 424dd8e7 .config log report syz C
ci-upstream-kasan-gce-smack-root 2020/08/16 22:48 upstream 2cc3c4b3c2e9 424dd8e7 .config log report syz C
ci-upstream-kasan-gce-root 2020/08/16 20:54 upstream 2cc3c4b3c2e9 424dd8e7 .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/08/20 13:04 linux-next 605cbf3d5f20 ed282a3a .config log report syz C
ci-upstream-kasan-gce-root 2020/08/16 20:30 upstream 2cc3c4b3c2e9 424dd8e7 .config log report
* Struck through repros no longer work on HEAD.