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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:01:42 +0000 (22:01 +0200)
commita71a03f3e9169d0b9b75f1a8b0b99efeff88915e
treee1b33d17569f084397bf09dda525818c2ceec058
parent5470fcaa7a54a9961d9b8431fe924455bee1af89
KVM: s390: fix get_all_floating_irqs

commit 94aa033efcac47b09db22cb561e135baf37b7887 upstream.

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.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/virtual/kvm/devices/s390_flic.txt
arch/s390/kvm/interrupt.c