From: Al Viro <viro@zeniv.linux.org.uk>
To: Sean Christopherson <seanjc@google.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH gmem FIXUP] kvm: guestmem: do not use a file system
Date: Tue, 10 Oct 2023 01:37:46 +0100 [thread overview]
Message-ID: <20231010003746.GN800259@ZenIV> (raw)
In-Reply-To: <ZSSaWPc5wjU9k1Kw@google.com>
On Mon, Oct 09, 2023 at 05:27:04PM -0700, Sean Christopherson wrote:
> If the last reference is effectively held by guest_memfd, it would be:
>
> kvm_gmem_release(), a.k.a. file_operations.release()
> |
> -> kvm_put_kvm()
> |
> -> kvm_destroy_vm()
> |
> -> module_put(kvm_chardev_ops.owner);
... and now your thread gets preempted and loses CPU; before you get
it back, some joker calls delete_module(), and page of code containing
kvm_gmem_release() is unmapped. Even though an address within that
page is stored as return address in a frame on your thread's stack.
That thread gets the timeslice again and proceeds to return into
unmapped page. Oops...
next prev parent reply other threads:[~2023-10-10 0:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 18:06 [PATCH gmem FIXUP] kvm: guestmem: do not use a file system Paolo Bonzini
2023-09-29 2:22 ` Sean Christopherson
2023-10-09 2:22 ` Al Viro
2023-10-09 2:35 ` Al Viro
2023-10-09 14:32 ` Sean Christopherson
2023-10-09 20:06 ` Al Viro
2023-10-09 20:20 ` Sean Christopherson
2023-10-09 20:40 ` Al Viro
2023-10-09 21:26 ` Sean Christopherson
2023-10-10 0:09 ` Al Viro
2023-10-10 0:27 ` Sean Christopherson
2023-10-10 0:37 ` Al Viro [this message]
2023-10-10 23:30 ` Sean Christopherson
2023-10-11 15:06 ` Xu Yilun
2023-10-11 17:57 ` Paolo Bonzini
2023-10-13 16:55 ` Sean Christopherson
2023-10-16 15:19 ` Paolo Bonzini
2023-10-09 2:16 ` Al Viro
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=20231010003746.GN800259@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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