OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:03:39 +0000 (22:03 +0200)
commit98529eff3f93a3179a35f9ae459e21f64e8be813
treefddf02e5a06d75fe10523ff9d9361bff4b4f5efa
parentbcdd54ffac32205938fa2cdd656604973275214b
KVM: s390: reinjection of irqs can fail in the tpi handler

commit 15462e37ca848abac7477dece65f8af25febd744 upstream.

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>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.h
arch/s390/kvm/priv.c