syzbot


memory leak in kvm_set_memslot

Status: fixed on 2023/02/24 13:50
Subsystems: kvm
[Documentation on labels]
Fix commit: c87661f855c3 KVM: Free new dirty bitmap if creating a new memslot fails
First crash: 871d, last: 871d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH 5.17 000/158] 5.17.10-rc1 review 172 (172) 2022/05/25 20:05
[PATCH] KVM: Free new dirty bitmap if creating a new memslot fails 2 (2) 2022/05/20 13:44

Sample crash report:
executing program
BUG: memory leak
unreferenced object 0xffffc900003f5000 (size 4096):
  comm "syz-executor410", pid 3597, jiffies 4294945449 (age 13.410s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffffff81512060>] __vmalloc_node_range+0xb40/0xbd0 mm/vmalloc.c:3195
    [<ffffffff81512239>] __vmalloc_node mm/vmalloc.c:3232 [inline]
    [<ffffffff81512239>] __vmalloc+0x49/0x50 mm/vmalloc.c:3246
    [<ffffffff814ab1e9>] __vmalloc_array mm/util.c:671 [inline]
    [<ffffffff814ab1e9>] __vcalloc+0x49/0x70 mm/util.c:694
    [<ffffffff8103dfed>] kvm_alloc_dirty_bitmap arch/x86/kvm/../../../virt/kvm/kvm_main.c:1319 [inline]
    [<ffffffff8103dfed>] kvm_prepare_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1551 [inline]
    [<ffffffff8103dfed>] kvm_set_memslot+0x1bd/0x690 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1782
    [<ffffffff8103eb49>] __kvm_set_memory_region+0x689/0x750 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1949
    [<ffffffff810452b7>] kvm_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1962 [inline]
    [<ffffffff810452b7>] kvm_vm_ioctl_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1974 [inline]
    [<ffffffff810452b7>] kvm_vm_ioctl+0x377/0x13a0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4528
    [<ffffffff815e41fc>] vfs_ioctl fs/ioctl.c:51 [inline]
    [<ffffffff815e41fc>] __do_sys_ioctl fs/ioctl.c:870 [inline]
    [<ffffffff815e41fc>] __se_sys_ioctl fs/ioctl.c:856 [inline]
    [<ffffffff815e41fc>] __x64_sys_ioctl+0xfc/0x140 fs/ioctl.c:856
    [<ffffffff84565f25>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f25>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae


Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/05/17 02:39 upstream 42226c989789 744a39e2 .config console log report syz C ci-upstream-gce-leak memory leak in kvm_set_memslot
* Struck through repros no longer work on HEAD.