public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nico Boehr" <nrb@linux.ibm.com>
To: "Claudio Imbrenda" <imbrenda@linux.ibm.com>, <kvm@vger.kernel.org>
Cc: <linux-s390@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<frankja@linux.ibm.com>, <borntraeger@de.ibm.com>
Subject: Re: [PATCH v1 1/1] KVM: s390: VSIE: fix virtual/physical address in unpin_scb()
Date: Tue, 10 Dec 2024 13:38:04 +0100	[thread overview]
Message-ID: <D680YIBTB8K9.3JYA0MCKDK0H9@linux.ibm.com> (raw)
In-Reply-To: <20241210083948.23963-1-imbrenda@linux.ibm.com>

On Tue Dec 10, 2024 at 9:39 AM CET, Claudio Imbrenda wrote:
> In commit 77b533411595 ("KVM: s390: VSIE: sort out virtual/physical
> address in pin_guest_page"), only pin_scb() has been updated. This
> means that in unpin_scb() a virtual address was still used directly as
> physical address without conversion. The resulting physical address is
> obviously wrong and most of the time also invalid.
>
> Since commit d0ef8d9fbebe ("KVM: s390: Use kvm_release_page_dirty() to
> unpin "struct page" memory"), unpin_guest_page() will directly use
> kvm_release_page_dirty(), instead of kvm_release_pfn_dirty(), which has
> since been removed.
>
> One of the checks that were performed by kvm_release_pfn_dirty() was to
> verify whether the page was valid at all, and silently return
> successfully without doing anything if the page was invalid.
>
> When kvm_release_pfn_dirty() was still used, the invalid page was thus
> silently ignored. Now the check is gone and the result is an Oops.
> This also means that when running with a V!=R kernel, the page was not
> released, causing a leak.
>
> The solution is simply to add the missing virt_to_phys().
>
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Fixes: 77b533411595 ("KVM: s390: VSIE: sort out virtual/physical address in pin_guest_page")

Reviewed-by: Nico Boehr <nrb@linux.ibm.com>

      parent reply	other threads:[~2024-12-10 12:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10  8:39 [PATCH v1 1/1] KVM: s390: VSIE: fix virtual/physical address in unpin_scb() Claudio Imbrenda
2024-12-10 11:39 ` Janosch Frank
2024-12-10 12:38 ` Nico Boehr [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=D680YIBTB8K9.3JYA0MCKDK0H9@linux.ibm.com \
    --to=nrb@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /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