mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	柳菁峰 <liujingfeng@qianxin.com>, "Wei Wang" <wei.w.wang@intel.com>,
	"Michal Luczaj" <mhal@rbox.co>
Subject: Re: [PATCH] KVM: Destroy target device if coalesced MMIO unregistration fails
Date: Wed,  1 Feb 2023 22:37:35 +0000	[thread overview]
Message-ID: <167528558345.768469.17759293608992301689.b4-ty@google.com> (raw)
In-Reply-To: <20221219171924.67989-1-seanjc@google.com>

On Mon, 19 Dec 2022 17:19:24 +0000, Sean Christopherson wrote:
> Destroy and free the target coalesced MMIO device if unregistering said
> device fails.  As clearly noted in the code, kvm_io_bus_unregister_dev()
> does not destroy the target device.
> 
>   BUG: memory leak
>   unreferenced object 0xffff888112a54880 (size 64):
>     comm "syz-executor.2", pid 5258, jiffies 4297861402 (age 14.129s)
>     hex dump (first 32 bytes):
>       38 c7 67 15 00 c9 ff ff 38 c7 67 15 00 c9 ff ff  8.g.....8.g.....
>       e0 c7 e1 83 ff ff ff ff 00 30 67 15 00 c9 ff ff  .........0g.....
>     backtrace:
>       [<0000000006995a8a>] kmalloc include/linux/slab.h:556 [inline]
>       [<0000000006995a8a>] kzalloc include/linux/slab.h:690 [inline]
>       [<0000000006995a8a>] kvm_vm_ioctl_register_coalesced_mmio+0x8e/0x3d0 arch/x86/kvm/../../../virt/kvm/coalesced_mmio.c:150
>       [<00000000022550c2>] kvm_vm_ioctl+0x47d/0x1600 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3323
>       [<000000008a75102f>] vfs_ioctl fs/ioctl.c:46 [inline]
>       [<000000008a75102f>] file_ioctl fs/ioctl.c:509 [inline]
>       [<000000008a75102f>] do_vfs_ioctl+0xbab/0x1160 fs/ioctl.c:696
>       [<0000000080e3f669>] ksys_ioctl+0x76/0xa0 fs/ioctl.c:713
>       [<0000000059ef4888>] __do_sys_ioctl fs/ioctl.c:720 [inline]
>       [<0000000059ef4888>] __se_sys_ioctl fs/ioctl.c:718 [inline]
>       [<0000000059ef4888>] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:718
>       [<000000006444fa05>] do_syscall_64+0x9f/0x4e0 arch/x86/entry/common.c:290
>       [<000000009a4ed50b>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
> 
> [...]

Applied to kvm-x86 generic, the plan is that Wei will send the bigger
cleanup on top.  Thanks!

[1/1] KVM: Destroy target device if coalesced MMIO unregistration fails
      https://github.com/kvm-x86/linux/commit/b1cb1fac22ab

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes

      parent reply	other threads:[~2023-02-01 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 17:19 Sean Christopherson
2022-12-20  3:04 ` Wang, Wei W
2022-12-20  6:05   ` Binbin Wu
2022-12-23 17:13   ` Paolo Bonzini
2022-12-26 10:17     ` Wang, Wei W
2023-01-03 16:33       ` Sean Christopherson
2023-02-01 22:37 ` Sean Christopherson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=167528558345.768469.17759293608992301689.b4-ty@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liujingfeng@qianxin.com \
    --cc=mhal@rbox.co \
    --cc=pbonzini@redhat.com \
    --cc=wei.w.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®