KVM: s390: fix get_all_floating_irqs
authorJens Freimann <jfrei@linux.vnet.ibm.com>
Mon, 16 Mar 2015 11:17:13 +0000 (12:17 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 17 May 2015 23:11:49 +0000 (19:11 -0400)
commit00d83726cc64e9a1e1e2f60471235e9cfaa86d1e
tree615fec12086ca6ab0db28d9c7ead59ef1ff8806b
parent7e15bc0e1c8b239a82005a884b1bce9260024ecb
KVM: s390: fix get_all_floating_irqs

[ Upstream commit 94aa033efcac47b09db22cb561e135baf37b7887 ]

This fixes a bug introduced with commit c05c4186bbe4 ("KVM: s390:
add floating irq controller").

get_all_floating_irqs() does copy_to_user() while holding
a spin lock. Let's fix this by filling a temporary buffer
first and copy it to userspace after giving up the lock.

Cc: <stable@vger.kernel.org> # 3.18+: 69a8d4562638 KVM: s390: no need to hold...
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Documentation/virtual/kvm/devices/s390_flic.txt
arch/s390/kvm/interrupt.c