]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:11:48 +0000 (19:11 -0400)
commitb7c23d30eeb287801113c66e10c0d79387ee02e1
treebe9bdd05365c1a1ce3418f62ce220f7ff2a87331
parent19881aff151277b639c6bc5c1965750bdeccadcc
KVM: s390: reinjection of irqs can fail in the tpi handler

[ Upstream commit 15462e37ca848abac7477dece65f8af25febd744 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/s390/kvm/interrupt.c
arch/s390/kvm/kvm-s390.h
arch/s390/kvm/priv.c