From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [GIT PULL 3/8] KVM: s390: fix get_all_floating_irqs Date: Tue, 31 Mar 2015 16:42:43 +0200 Message-ID: <551AB263.90201@de.ibm.com> References: <1427806923-21910-1-git-send-email-borntraeger@de.ibm.com> <1427806923-21910-4-git-send-email-borntraeger@de.ibm.com> <20150331141257.GC4479@osiris> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: KVM , Paolo Bonzini , Marcelo Tosatti , Alexander Graf , Cornelia Huck , Jens Freimann , linux-s390 , stable@vger.kernel.org To: Heiko Carstens Return-path: Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:48203 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754445AbbCaOmt (ORCPT ); Tue, 31 Mar 2015 10:42:49 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Mar 2015 15:42:47 +0100 In-Reply-To: <20150331141257.GC4479@osiris> Sender: kvm-owner@vger.kernel.org List-ID: Am 31.03.2015 um 16:12 schrieb Heiko Carstens: > On Tue, Mar 31, 2015 at 03:01:58PM +0200, Christian Borntraeger wrote: >> From: Jens Freimann >> >> 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: # 3.18+: 69a8d4562638 KVM: s390: no need to hold... >> >> Reviewed-by: David Hildenbrand >> Signed-off-by: Jens Freimann >> Signed-off-by: Christian Borntraeger >> Acked-by: Cornelia Huck > > ... > >> -static int get_all_floating_irqs(struct kvm *kvm, __u8 *buf, __u64 len) >> +static int get_all_floating_irqs(struct kvm *kvm, __user u8 *usrbuf, u64 len) > > fwiw, this is probably the only place within the kernel where we see > "__user u8 *" instead of "u8 __user *". This is odd within this whole > patch. > >> + if (copy_to_user((void __user *) usrbuf, > > The cast shouldn't be necessary at all... > Yes, will fixup. Paolo, Marcelo, I will resend the pull request. But do not hesitate to review the other patches :-) Christian