Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6881404imu; Thu, 31 Jan 2019 01:00:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN65xzAC562GhxI3iZ4PszeiCcr+/1es+JP72xX3OHYiG1xpt0QWzAimYvB00AcRuYL1ozkg X-Received: by 2002:a62:42d4:: with SMTP id h81mr33827067pfd.259.1548925245597; Thu, 31 Jan 2019 01:00:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548925245; cv=none; d=google.com; s=arc-20160816; b=C/gsbFcVmOhBVfxsC5yA5/RGfbSrXWgw8u/77owF98F3Fx6g3Dsl/hLd0k7frwtEM7 +KyHXzPR6WG2qoo34fYoGOj3sGqbo990cdY06gV99/xw203JtiXK4HOmM2ZVyXd6XUi4 oUZ5MmcpgVvd6GWj18gHtNmuYkYO3yWFswqSaNO2ZBhV65DhgSLUlMCvvZ6VX7audgTg mN4e0xkD1RhkEe2fwV5uDHL9zuUSw5+RFzJrGm6L84hzrkVUeXDMl1k73r2BVH4s2vh+ fWe5sGagzc9B8Kg+1d0fiDr23c0cda60+69J58SzpBAlL3KhLyxajUcNd98BQLt+TB2Z FKig== 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-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :organization:from:references:cc:to:subject:reply-to; bh=vLbLzlYJ9ZQl1qSUv5blJezjczfMcIF8bSKLBoUC3cg=; b=c5ekbWem+obrtGDW9LxvZSSonYJGx/pQrm/fch35ZAiAktpkT6bJQM7ykf0GR6x6Bl 6WMchQvHzt2Hh/gt/Wnz+tv/XOo+PxuWKC3TQ4TlZxHhP0Sad2Oq5Iqk6Ctla1VrSS+G 4p96IDQgZfsDuBS3pMwcAhoK5iSBrraIdkZr8cr2OsfPWzPYjUC2K705mMsCKhgu4uOw cWajSXlrnlIZMurtZFbwFmzWH5fdSgPft4/dUpzG9zZU5S1zL3ueNg6MZ2i/ML8krxq/ Yios0SvXcMvrKs3p3VZagok88rIejPrH/v9D1fHv6ZXqCxnGFzcDZK/c0DmkquKMYwC6 q6yQ== 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 z8si3733653pgf.577.2019.01.31.01.00.30; Thu, 31 Jan 2019 01:00:45 -0800 (PST) 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 S1726464AbfAaI7o (ORCPT + 99 others); Thu, 31 Jan 2019 03:59:44 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53174 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725787AbfAaI7n (ORCPT ); Thu, 31 Jan 2019 03:59:43 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0V8x5qa051741 for ; Thu, 31 Jan 2019 03:59:42 -0500 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2qbw2h2y0e-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 Jan 2019 03:59:42 -0500 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Jan 2019 08:59:40 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 Jan 2019 08:59:38 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0V8xbmt33489094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 Jan 2019 08:59:37 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DF6BE11C054; Thu, 31 Jan 2019 08:59:36 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8515511C058; Thu, 31 Jan 2019 08:59:36 +0000 (GMT) Received: from [9.152.224.122] (unknown [9.152.224.122]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 31 Jan 2019 08:59:36 +0000 (GMT) Reply-To: mimu@linux.ibm.com Subject: Re: [PATCH v7 15/15] KVM: s390: test for non NULL gisa origin in pending_irqs() To: KVM Mailing List Cc: Linux-S390 Mailing List , linux-kernel@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Halil Pasic , Pierre Morel References: <20190131085247.13826-1-mimu@linux.ibm.com> <20190131085247.13826-17-mimu@linux.ibm.com> From: Michael Mueller Organization: IBM Date: Thu, 31 Jan 2019 09:59:36 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190131085247.13826-17-mimu@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 19013108-4275-0000-0000-0000030839C6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19013108-4276-0000-0000-00003816425F Message-Id: <0119eb6e-aa0a-3ab5-9919-6ebeb647533a@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-31_04:,, 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901310072 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ignore this patch please, it has the wrong commit message. The following is the right patch: "KVM: s390: fix possible null pointer dereference in pending_irqs()" On 31.01.19 09:52, Michael Mueller wrote: > Assure a GISA is in use before accessing the IPM to avoid > a NULL pointer de-referencing issue. > > Reported-by: Halil Pasic > Signed-off-by: Michael Mueller > --- > arch/s390/kvm/interrupt.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c > index d322400ca587..660ec87b6e60 100644 > --- a/arch/s390/kvm/interrupt.c > +++ b/arch/s390/kvm/interrupt.c > @@ -329,9 +329,13 @@ static inline unsigned long pending_irqs_no_gisa(struct kvm_vcpu *vcpu) > > static inline unsigned long pending_irqs(struct kvm_vcpu *vcpu) > { > - return pending_irqs_no_gisa(vcpu) | > - gisa_get_ipm(vcpu->kvm->arch.gisa_int.origin) << > - IRQ_PEND_IO_ISC_7; > + struct kvm_s390_gisa_interrupt *gi = &vcpu->kvm->arch.gisa_int; > + unsigned long pending_mask; > + > + pending_mask = pending_irqs_no_gisa(vcpu); > + if (gi->origin) > + pending_mask |= gisa_get_ipm(gi->origin) << IRQ_PEND_IO_ISC_7; > + return pending_mask; > } > > static inline int isc_to_irq_type(unsigned long isc) -- Mit freundlichen Grüßen / Kind regards Michael Müller IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Matthias Hartmann Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294