From: ehrhardt@linux.vnet.ibm.com
To: Avi Kivity <avi@redhat.com>, kvm@vger.kernel.org
Cc: ehrhardt@linux.vnet.ibm.com,
Christian Borntraeger <borntraeger@de.ibm.com>,
Carsten Otte <cotte@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [PATCH 6/6] kvm-s390: Verify memory in kvm run
Date: Tue, 12 May 2009 17:21:53 +0200 [thread overview]
Message-ID: <1242141713-20863-7-git-send-email-ehrhardt@linux.vnet.ibm.com> (raw)
In-Reply-To: <1242141713-20863-1-git-send-email-ehrhardt@linux.vnet.ibm.com>
From: Carsten Otte <cotte@de.ibm.com>
This check verifies that the guest we're trying to run in KVM_RUN
has some memory assigned to it. It enters an endless exception
loop if this is not the case.
Reported-by: Mijo Safradin <mijo@linux.vnet.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@de.ibm.com>
---
arch/s390/kvm/kvm-s390.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: kvm/arch/s390/kvm/kvm-s390.c
===================================================================
--- kvm.orig/arch/s390/kvm/kvm-s390.c
+++ kvm/arch/s390/kvm/kvm-s390.c
@@ -478,6 +478,12 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_v
vcpu_load(vcpu);
+ /* verify, that memory has been registered */
+ if (!vcpu->kvm->arch.guest_memsize) {
+ vcpu_put(vcpu);
+ return -EINVAL;
+ }
+
if (vcpu->sigset_active)
sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved);
next prev parent reply other threads:[~2009-05-12 15:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-12 15:21 [PATCH 0/6] kvm-s390: collection of kvm-s390 fixes - v3 ehrhardt
2009-05-12 15:21 ` [PATCH 1/6] kvm-s390: Fix memory slot versus run " ehrhardt
2009-05-12 15:21 ` [PATCH 2/6] kvm-s390: use hrtimer for clock wakeup from idle - v2 ehrhardt
2009-05-12 15:21 ` [PATCH 3/6] kvm-s390: optimize float int lock: spin_lock_bh --> spin_lock ehrhardt
2009-05-12 15:21 ` [PATCH 4/6]: kvm-s390: Unlink vcpu on destroy - v2 ehrhardt
2009-05-12 15:21 ` [PATCH 5/6] kvm-s390: Sanity check on validity intercept ehrhardt
2009-05-12 15:21 ` ehrhardt [this message]
2009-05-13 7:44 ` [PATCH 0/6] kvm-s390: collection of kvm-s390 fixes - v3 Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2009-05-05 14:39 [PATCH 0/6] kvm-s390: collection of kvm-s390 fixes ehrhardt
2009-05-05 14:39 ` [PATCH 6/6] kvm-s390: Verify memory in kvm run ehrhardt
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=1242141713-20863-7-git-send-email-ehrhardt@linux.vnet.ibm.com \
--to=ehrhardt@linux.vnet.ibm.com \
--cc=avi@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cotte@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=schwidefsky@de.ibm.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