Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5997281ybe; Tue, 10 Sep 2019 11:56:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRenMlDOnWQ+sHJ6lO1GiYx/YEzVlRWM7TpcMjyIDSo/lAOPt5lZynektfmWpmODMlUtzb X-Received: by 2002:a17:906:318d:: with SMTP id 13mr25555392ejy.281.1568141779254; Tue, 10 Sep 2019 11:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141779; cv=none; d=google.com; s=arc-20160816; b=o/JcuEa9kJutoHo8xl3rhIMsIWrJXpkphJabySyjgN/QKYa+Z7E6QWtTLs8HDtcoMC hBjWWmUC8ftuzWVSL6HFSzEwFxE3r/GRo3+Eb3LGRikUgVJzB8piJT527DtG6wUNsFh8 6g1fa1pc9B3hpIxNOPIoWT1gQzLhMfUXgcCxTfm7Ah/NNOUObboxfjH0+yd1aN44Gy4w 3/NbBJO0hDxOh+N2/ViQlnOknYRy8YGLdDdfUuW2kmCzqdzmn971ixKp6MdF0A2tHWa7 nOz1qi7aPc83+9NsNpGZxah0+WjLrRTpcJaoGqDfHj8OTfYCzTuDDt0QARdxRYXsCynM 0ytg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:organization:references:in-reply-to:subject:cc:to:from :date; bh=KapolFZkDbx7zGMowyC+jSGDQZFmyqOgNsinsEPJnqQ=; b=PnKs80ilvp5QhOD2Mw9GjJEwf31GUpRQOxJTM5FnvnjqnXB4Em2x9LA2UoLj3MIxYh 2pUoXxhmzqXOT4itqqTXzSIIvx3DHUOx+V1JoICw/nIWjRwJj1zkicUq8A4M2MaM47fP tmeX5Ik9kMeYdcEbpIcTQ4GNoUeKR3A3AwkixjFtApN5usalgsTnUUp6UCT6pWQMoFmt tl8lGIqrK0kpLGutAAxxEqM0Brnt48E13Dhk8R3nbQI7AnUVNqRXB1XP7Qv6bZo9OBd2 HZZlWCIPjDNFnTLWJ4wIX5yFK0ApDt+VZ0uuw3EWwu2x2o3y7SESSwzIBloGC/TU8Lqk pJ1Q== 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 f15si9981707ejc.246.2019.09.10.11.55.55; Tue, 10 Sep 2019 11:56:19 -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 S1729192AbfIJKVX (ORCPT + 99 others); Tue, 10 Sep 2019 06:21:23 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49598 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbfIJKVX (ORCPT ); Tue, 10 Sep 2019 06:21:23 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8AAIHSZ125873 for ; Tue, 10 Sep 2019 06:21:21 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ux6t3xj4d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 10 Sep 2019 06:21:21 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Sep 2019 11:21:18 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 10 Sep 2019 11:21:15 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8AALDcq59441152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Sep 2019 10:21:13 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C98E1A4053; Tue, 10 Sep 2019 10:21:13 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 918DFA4040; Tue, 10 Sep 2019 10:21:13 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.39]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 10 Sep 2019 10:21:13 +0000 (GMT) Date: Tue, 10 Sep 2019 12:21:12 +0200 From: Claudio Imbrenda To: Christian Borntraeger Cc: Igor Mammedov , linux-kernel@vger.kernel.org, david@redhat.com, cohuck@redhat.com, Janosch Frank Subject: Re: [PATCH] kvm_s390_vm_start_migration: check dirty_bitmap before using it as target for memset() In-Reply-To: <4668e4e9-c0bc-3647-6387-20c6f8107ed3@de.ibm.com> References: <20190909145545.11759-1-imammedo@redhat.com> <4668e4e9-c0bc-3647-6387-20c6f8107ed3@de.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19091010-0012-0000-0000-000003497464 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091010-0013-0000-0000-00002183D856 Message-Id: <20190910122112.098e3494@p-imbrenda.boeblingen.de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-10_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=773 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909100105 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Sep 2019 18:21:47 +0200 Christian Borntraeger wrote: [...] > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > > index f329dcb3f44c..dfba51c9d60c 100644 > > --- a/arch/s390/kvm/kvm-s390.c > > +++ b/arch/s390/kvm/kvm-s390.c > > @@ -1018,6 +1018,10 @@ static int > > kvm_s390_vm_start_migration(struct kvm *kvm) /* mark all the pages > > in active slots as dirty */ for (slotnr = 0; slotnr < > > slots->used_slots; slotnr++) { ms = slots->memslots + slotnr; > > + if (!ms->dirty_bitmap) { > > + WARN(1, "ms->dirty_bitmap == NULL\n"); > > I would prefer to not have a WARN_ON. Otherwise this would allow a > malicious user to spam the log. I agree, the WARN is not needed. > > > + return -EINVAL; > > + } > > /* > > * The second half of the bitmap is only used on > > x86, > > * and would be wasted otherwise, so we put it to > > good Otherwise it looks good. Claudio Imbrenda