]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitecc313f5c8ca848a6dae17bfd1e11a51064b750c
tree3c1c0a7696fb9fc9775e1051ca683fd4349e851b
parent5a790b72911629740f969a7f1c05978e514e90fb
KVM: s390: reinjection of irqs can fail in the tpi handler

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