From patchwork Mon Nov 30 16:14:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carsten Otte X-Patchwork-Id: 63721 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAUGE6oZ007781 for ; Mon, 30 Nov 2009 16:14:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460AbZK3QN6 (ORCPT ); Mon, 30 Nov 2009 11:13:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752641AbZK3QN6 (ORCPT ); Mon, 30 Nov 2009 11:13:58 -0500 Received: from mtagate5.de.ibm.com ([195.212.17.165]:34588 "EHLO mtagate5.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbZK3QN5 (ORCPT ); Mon, 30 Nov 2009 11:13:57 -0500 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.1/8.13.1) with ESMTP id nAUGE3ch028323 for ; Mon, 30 Nov 2009 16:14:03 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nAUGE3lk1077474 for ; Mon, 30 Nov 2009 17:14:03 +0100 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id nAUGE2M9020747 for ; Mon, 30 Nov 2009 17:14:03 +0100 Received: from [9.152.224.45] (dyn-9-152-224-45.boeblingen.de.ibm.com [9.152.224.45]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id nAUGE1tL020713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2009 17:14:02 +0100 Message-ID: <4B13EF71.3080905@de.ibm.com> Date: Mon, 30 Nov 2009 17:14:41 +0100 From: Carsten Otte Organization: =?ISO-8859-1?Q?IBM_Deutschland_Research_=26_Develop?= =?ISO-8859-1?Q?ment_GmbH=2CVorsitzender_des_Aufsichtsrats=3A_Mar?= =?ISO-8859-1?Q?tin_Jetter=2CGesch=E4ftsf=FChrung=3A_Dirk_Wittkopp=2C?= =?ISO-8859-1?Q?Sitz_der_Gesellschaft=3A_B=F6blingen=2CRegistergeri?= =?ISO-8859-1?Q?cht=3A_Amtsgericht_Stuttgart=2C_HRB_243294?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Avi Kivity CC: Alexander Graf , Heiko Carstens , KVM list , stable@kernel.org, Martin Schwidefsky Subject: Fix prefix register checking in arch/s390/kvm/sigp.c Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Index: kvm/arch/s390/kvm/sigp.c =================================================================== --- kvm.orig/arch/s390/kvm/sigp.c 2009-10-13 11:09:04.000000000 +0200 +++ kvm/arch/s390/kvm/sigp.c 2009-11-30 16:46:21.000000000 +0100 @@ -188,9 +188,9 @@ /* make sure that the new value is valid memory */ address = address & 0x7fffe000u; - if ((copy_from_guest(vcpu, &tmp, - (u64) (address + vcpu->arch.sie_block->gmsor) , 1)) || - (copy_from_guest(vcpu, &tmp, (u64) (address + + if ((copy_from_user(&tmp, (void __user *) + (address + vcpu->arch.sie_block->gmsor) , 1)) || + (copy_from_user(&tmp, (void __user *)(address + vcpu->arch.sie_block->gmsor + PAGE_SIZE), 1))) { *reg |= SIGP_STAT_INVALID_PARAMETER; return 1; /* invalid parameter */