Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp600998ybe; Wed, 11 Sep 2019 01:39:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgBRwK/2XEw3Uhkgr5WD0Auzm21d1XYW1R+BwR+wqolzqnT0svzcqV+KlzkK7pL2SCwbwd X-Received: by 2002:a17:906:5214:: with SMTP id g20mr28151777ejm.220.1568191149933; Wed, 11 Sep 2019 01:39:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568191149; cv=none; d=google.com; s=arc-20160816; b=aD8vT92cyX3KRZRzeEscCDwHA+MWPIQySAozziTuAxmQA2Jn5/HlX+CuBq/oT+oh+N zyO+L+a2T/kNfqDinbZw7kjN+jfiM00vanmqqOL5oaKvNSk4hvRln12DLPsf3WtBLqJE Y+Ud741/eIgXjpHdydHdaeDL/QMOr2MMkF/1BhlQI0b0C5m9OfotmOQKuCFthNqDEavK 2jPn+Ak0yJvUPy3FfHzMxKTZSCIvhUApFCiz6NZzWHhpWL0IenPUQjerlef3scRaPBR9 CUcQTHX1vmA5AGxPfEqlxFNPVx4IJgfE34UNdVPLAz6ptdPpQW2xk5A2SzM/+AeAlojf EUzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:mime-version :user-agent:date:autocrypt:openpgp:from:references:cc:to:subject; bh=mQL5c/XufP53AncAiyqhn70HASA7+DhVREhVe1/o/o4=; b=uwUVRogRs36sGEec/wHMML9oWb6VJ8NrkXO0aHp31xW6J7+Psv0eJ/ctrSTw+JTtIz ktGV3kId5DmaNTm7twV7XONTxAgIgf5bHiBO1D7L3eOnOCzJibZkCan8U5pUbV1xhyp4 X3fIusHfynZGJM+npWZUkYctnjoon9PW21Otr4xZceZWnPWzRK2ESvl7Nwq+bLDWTqcY uHcWmkyqreOJTxay3qFgfHh6PC0FJKeZ/EfaYWCoI7pSTONj1E5O8Dj+WcNIMj00DoMh Y43J8RzOlG0U2GcszjXLbcj+BYGUL1r5YDyHJV6PocCIHYcwsUlS1l29TBwmKaj2/BPA 2DrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si10952951ejb.308.2019.09.11.01.38.45; Wed, 11 Sep 2019 01:39:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727224AbfIKIgr (ORCPT + 99 others); Wed, 11 Sep 2019 04:36:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:2170 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbfIKIgr (ORCPT ); Wed, 11 Sep 2019 04:36:47 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8B8Vbrf121158 for ; Wed, 11 Sep 2019 04:36:46 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uxu0ew28a-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Sep 2019 04:36:45 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Sep 2019 09:36:43 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 11 Sep 2019 09:36:40 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8B8adlH56229922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2019 08:36:39 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FE1BAE051; Wed, 11 Sep 2019 08:36:39 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACAD3AE057; Wed, 11 Sep 2019 08:36:38 +0000 (GMT) Received: from dyn-9-152-224-131.boeblingen.de.ibm.com (unknown [9.152.224.131]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 11 Sep 2019 08:36:38 +0000 (GMT) Subject: Re: [PATCH v2] KVM: s390: kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset() To: Igor Mammedov , linux-kernel@vger.kernel.org Cc: borntraeger@de.ibm.com, david@redhat.com, cohuck@redhat.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, imbrenda@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org References: <20190911075218.29153-1-imammedo@redhat.com> From: Janosch Frank Openpgp: preference=signencrypt Autocrypt: addr=frankja@linux.ibm.com; prefer-encrypt=mutual; keydata= mQINBFubpD4BEADX0uhkRhkj2AVn7kI4IuPY3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fXWiYu7ObeErT6iLSTZGx4rQARAQABiQIfBBgBCAAJ BQJbm6Q+AhsMAAoJEONU5rjiOLn4DDEP/RuyckW65SZcPG4cMfNgWxZF8rVjeVl/9PBfy01K 8R0hajU40bWtXSMiby7j0/dMjz99jN6L+AJHJvrLz4qYRzn2Ys843W+RfXj62Zde4YNBE5SL jJweRCbMWKaJLj6499fctxTyeb9+AMLQS4yRSwHuAZLmAb5AyCW1gBcTWZb8ON5BmWnRqeGm IgC1EvCnHy++aBnHTn0m+zV89BhTLTUal35tcjUFwluBY39R2ux/HNlBO1GY3Z+WYXhBvq7q katThLjaQSmnOrMhzqYmdShP1leFTVbzXUUIYv/GbynO/YrL2gaQpaP1bEUEi8lUAfXJbEWG dnHFkciryi092E8/9j89DJg4mmZqOau7TtUxjRMlBcIliXkzSLUk+QvD4LK1kWievJse4mte FBdkWHfP4BH/+8DxapRcG1UAheSnSRQ5LiO50annOB7oXF+vgKIaie2TBfZxQNGAs3RQ+bga DchCqFm5adiSP5+OT4NjkKUeGpBe/aRyQSle/RropTgCi85pje/juYEn2P9UAgkfBJrOHvQ9 Z+2Sva8FRd61NJLkCJ4LFumRn9wQlX2icFbi8UDV3do0hXJRRYTWCxrHscMhkrFWLhYiPF4i phX7UNdOWBQ90qpHyAxHmDazdo27gEjfvsgYMdveKknEOTEb5phwxWgg7BcIDoJf9UMC Date: Wed, 11 Sep 2019 10:36:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190911075218.29153-1-imammedo@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vRyjy3CQeEKOH3G9VNNkmYEGONAMZRI1Y" X-TM-AS-GCONF: 00 x-cbid: 19091108-0016-0000-0000-000002A9EF85 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091108-0017-0000-0000-0000330A7A92 Message-Id: <19baa04d-0d77-7a80-65e2-e00b0d096811@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-11_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=838 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909110081 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vRyjy3CQeEKOH3G9VNNkmYEGONAMZRI1Y Content-Type: multipart/mixed; boundary="dzBoqpYyJe1rGZE0BD3rqKHntsX41AMyO"; protected-headers="v1" From: Janosch Frank To: Igor Mammedov , linux-kernel@vger.kernel.org Cc: borntraeger@de.ibm.com, david@redhat.com, cohuck@redhat.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, imbrenda@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org Message-ID: <19baa04d-0d77-7a80-65e2-e00b0d096811@linux.ibm.com> Subject: Re: [PATCH v2] KVM: s390: kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset() References: <20190911075218.29153-1-imammedo@redhat.com> In-Reply-To: <20190911075218.29153-1-imammedo@redhat.com> --dzBoqpYyJe1rGZE0BD3rqKHntsX41AMyO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/11/19 9:52 AM, Igor Mammedov wrote: > If userspace doesn't set KVM_MEM_LOG_DIRTY_PAGES on memslot before call= ing > kvm_s390_vm_start_migration(), kernel will oops with: >=20 > Unable to handle kernel pointer dereference in virtual kernel address= space > Failing address: 0000000000000000 TEID: 0000000000000483 > Fault in home space mode while using kernel ASCE. > AS:0000000002a2000b R2:00000001bff8c00b R3:00000001bff88007 S:0000000= 1bff91000 P:000000000000003d > Oops: 0004 ilc:2 [#1] SMP > ... > Call Trace: > ([<001fffff804ec552>] kvm_s390_vm_set_attr+0x347a/0x3828 [kvm]) > [<001fffff804ecfc0>] kvm_arch_vm_ioctl+0x6c0/0x1998 [kvm] > [<001fffff804b67e4>] kvm_vm_ioctl+0x51c/0x11a8 [kvm] > [<00000000008ba572>] do_vfs_ioctl+0x1d2/0xe58 > [<00000000008bb284>] ksys_ioctl+0x8c/0xb8 > [<00000000008bb2e2>] sys_ioctl+0x32/0x40 > [<000000000175552c>] system_call+0x2b8/0x2d8 > INFO: lockdep is turned off. > Last Breaking-Event-Address: > [<0000000000dbaf60>] __memset+0xc/0xa0 >=20 > due to ms->dirty_bitmap being NULL, which might crash the host. >=20 > Make sure that ms->dirty_bitmap is set before using it or > return -ENIVAL otherwise. Fixed that while picking and added my reviewed-by, as well as the others you removed. Thanks for your patch. --dzBoqpYyJe1rGZE0BD3rqKHntsX41AMyO-- --vRyjy3CQeEKOH3G9VNNkmYEGONAMZRI1Y Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEwGNS88vfc9+v45Yq41TmuOI4ufgFAl14shYACgkQ41TmuOI4 ufhBAhAAoOSaWNtX+nzRWC/HmJHPpeav8+63Qo91vK6EVOpXq/A4mKa1Hcb/IMbg wrXMAxEg3ODpSBTHJzp9t9MjQwdHO8SKfJvcMAJhGHzeEuLycUSBbBdOns1UFwtl xa1Xcxlk3j8jVCqeQZCQHayj2iSKVlCeF6BVhvmtbMjMBwlUdrkjG3Fc1nX0XngU BrE+Of03FCmOe0PBa6OU5IsWyGDb6hO30uY7rdf79jPeb15TQqyEJtzSfoLcc4qh 3+6z9QVmJfC/he2kb7KB7K8KDzBTIp8QQUan4R/XGDKqVGkoIB/WPdkkVXNxoGSf Zy7i531iDZ8eexEwWP2dUSC681r7fermJUS7JWGmvuR15iGhfIvEkliQKG2kmQQ8 U9aeCtrW6hC2/zXbfJ3RZUl4/Km668cUMolgn2lSbta2p2ASsKZ/YsNFkVQYX9t2 cowNHv59ClN87LHRRzQDJj5lUVvncLG8oc7BK9o4Azo3y2iT8Hko7J2TJx1rHXjZ yUgSTsVOVhMXEdcGCmwgIZ964EAW0L2NnqXFrf8qUfo04yMgWwOPbThDYwx2o4XI mT6XsfiqUo+TIrqxJObH9cJEWJHT6ld3+AWqyWuApnZ/11lLT7Ue1Y2PO/xhLhHE qhUXYZgF1gQyRY2N1LD5w+GqZWtclRDf+/hA0d2tJrpzf49dKd4= =6bmL -----END PGP SIGNATURE----- --vRyjy3CQeEKOH3G9VNNkmYEGONAMZRI1Y--