KVM: s390: reinjection of irqs can fail in the tpi handler
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Wed, 4 Feb 2015 14:59:11 +0000 (15:59 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 6 Mar 2015 12:40:37 +0000 (13:40 +0100)
The reinjection of an I/O interrupt can fail if the list is at the limit
and between the dequeue and the reinjection, another I/O interrupt is
injected (e.g. if user space floods kvm with I/O interrupts).

This patch avoids this memory leak and returns -EFAULT in this special
case. This error is not recoverable, so let's fail hard. This can later
be avoided by not dequeuing the interrupt but working directly on the
locked list.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.h
arch/s390/kvm/priv.c

Simple merge
Simple merge
Simple merge