提交 b9fa6d6e 编写于 作者: M Michael Mueller 提交者: Christian Borntraeger

KVM: s390: fix possible null pointer dereference in pending_irqs()

Assure a GISA is in use before accessing the IPM to avoid a
null pointer dereference issue.
Signed-off-by: NMichael Mueller <mimu@linux.ibm.com>
Reported-by: NHalil Pasic <pasic@linux.ibm.com>
Reviewed-by: NPierre Morel <pmorel@linux.ibm.com>
Reviewed-by: NCornelia Huck <cohuck@redhat.com>
Message-Id: <20190131085247.13826-16-mimu@linux.ibm.com>
Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
上级 b1d1e76e
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册