syzbot


KASAN: use-after-free Read in __kvm_set_memory_region

Status: auto-closed as invalid on 2022/03/05 11:02
Reported-by: syzbot+e63dd6c5e04c4c10d20a@syzkaller.appspotmail.com
First crash: 902d, last: 902d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __kvm_set_memory_region kvm 1 2342d 2338d 0/26 closed as invalid on 2018/02/13 19:23

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in id_to_memslot include/linux/kvm_host.h:629 [inline]
BUG: KASAN: use-after-free in __kvm_set_memory_region+0x1d7e/0x1ed0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1011
Read of size 2 at addr ffff88823af4fd9c by task syz-executor.3/26103

CPU: 0 PID: 26103 Comm: syz-executor.3 Not tainted 4.19.211-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+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load2_noabort+0x88/0x90 mm/kasan/report.c:431
 id_to_memslot include/linux/kvm_host.h:629 [inline]
 __kvm_set_memory_region+0x1d7e/0x1ed0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1011
 kvm_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1144 [inline]
 kvm_vm_ioctl_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1156 [inline]
 kvm_vm_ioctl+0x78b/0x1700 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3248
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fd4d0b728a7
Code: 3c 1c 48 f7 d8 49 39 c4 72 b8 e8 04 54 02 00 85 c0 78 bd 48 83 c4 08 4c 89 e0 5b 41 5c c3 0f 1f 44 00 00 b8 10 00 00 00 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:00007fd4ce0e65f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000020fe3000 RCX: 00007fd4d0b728a7
RDX: 00007fd4ce0e6d30 RSI: 000000004020ae46 RDI: 000000000000000a
RBP: 000000000000000a R08: 0000000000000001 R09: 000000000000001d
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000fec00000
R13: 00007fd4ce0e6d30 R14: 000000000000000d R15: 0000000020fef000

The buggy address belongs to the page:
page:ffffea0008ebd3c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x57ff00000000000()
raw: 057ff00000000000 0000000000000000 ffffffff08eb0101 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88823af4fc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88823af4fd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88823af4fd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                            ^
 ffff88823af4fe00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88823af4fe80: 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/11/05 11:01 linux-4.19.y 3f8a27f9e27b 4c1be0be .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in __kvm_set_memory_region
* Struck through repros no longer work on HEAD.