Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-25 Thread Greg Kurz
On Mon, 25 Apr 2016 16:15:22 +0200 Radim Krčmář wrote: > 2016-04-22 16:50+0200, Greg Kurz: > > Just to be sure I haven't missed something: > > - change the spec to introduce the MAX_VCPU_ID concept > > - update all related checks in KVM > > - provide a KVM_CAP_MAX_VCPU_ID for userspace > > Tha

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-25 Thread Radim Krčmář
2016-04-22 16:50+0200, Greg Kurz: > Just to be sure I haven't missed something: > - change the spec to introduce the MAX_VCPU_ID concept > - update all related checks in KVM > - provide a KVM_CAP_MAX_VCPU_ID for userspace That is it, thanks a lot! (From nitpicks that come to my mind ... MAX_VCPU_

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Wei Yang
On Fri, Apr 22, 2016 at 11:30:45AM +0200, Greg Kurz wrote: >On Fri, 22 Apr 2016 17:21:03 +0800 >Wei Yang wrote: > >> Hi, Greg >> > >Hi Wei ! > >> One confusion. >> >> There are 5 kvm_arch_vcpu_create() while in this patch you changed 2 of them. >> Some particular reason? >> > >Yes and the reaso

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Greg Kurz
On Fri, 22 Apr 2016 15:40:30 +0200 Radim Krčmář wrote: > 2016-04-22 11:25+0200, Greg Kurz: > > Hi Radim ! > > > > On Thu, 21 Apr 2016 19:36:11 +0200 > > Radim Krčmář wrote: > > > > > 2016-04-21 18:45+0200, Greg Kurz: > > > > On Thu, 21 Apr 2016 18:00:19 +0200 > > > > Radim Krčmář wrote:

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Radim Krčmář
2016-04-22 13:19+0200, Igor Mammedov: > On Fri, 22 Apr 2016 11:25:38 +0200 > Greg Kurz wrote: >> On Thu, 21 Apr 2016 19:36:11 +0200 >> Radim Krčmář wrote: >> > 2016-04-21 18:45+0200, Greg Kurz: >> > > On Thu, 21 Apr 2016 18:00:19 +0200 >> > > Radim Krčmář wrote: >> > >> 2016-04-21 16:20+02

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Radim Krčmář
2016-04-22 11:25+0200, Greg Kurz: > Hi Radim ! > > On Thu, 21 Apr 2016 19:36:11 +0200 > Radim Krčmář wrote: > > > 2016-04-21 18:45+0200, Greg Kurz: > > > On Thu, 21 Apr 2016 18:00:19 +0200 > > > Radim Krčmář wrote: > > >> 2016-04-21 16:20+0200, Greg Kurz: > > >> > Commit 338c7dbadd26 ("KVM:

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Igor Mammedov
On Fri, 22 Apr 2016 11:25:38 +0200 Greg Kurz wrote: > Hi Radim ! > > On Thu, 21 Apr 2016 19:36:11 +0200 > Radim Krčmář wrote: > > > 2016-04-21 18:45+0200, Greg Kurz: > > > On Thu, 21 Apr 2016 18:00:19 +0200 > > > Radim Krčmář wrote: > > >> 2016-04-21 16:20+0200, Greg Kurz: [...] > >

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Cornelia Huck
On Fri, 22 Apr 2016 11:25:38 +0200 Greg Kurz wrote: > On Thu, 21 Apr 2016 19:36:11 +0200 > Radim Krčmář wrote: > > > For other architectures, it is simply KVM_MAX_VCPUS. > > > > (Other architectures would not implement the capability.) > > > > So this would be KVM_CAP_PPC_MAX_VCPU_ID ? >

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Greg Kurz
On Fri, 22 Apr 2016 17:21:03 +0800 Wei Yang wrote: > Hi, Greg > Hi Wei ! > One confusion. > > There are 5 kvm_arch_vcpu_create() while in this patch you changed 2 of them. > Some particular reason? > Yes and the reason is given in the changelog: - ARM and s390 already have such a check - Po

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Greg Kurz
Hi Radim ! On Thu, 21 Apr 2016 19:36:11 +0200 Radim Krčmář wrote: > 2016-04-21 18:45+0200, Greg Kurz: > > On Thu, 21 Apr 2016 18:00:19 +0200 > > Radim Krčmář wrote: > >> 2016-04-21 16:20+0200, Greg Kurz: > >> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter > >> > (CVE-2013-4587)

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-22 Thread Wei Yang
Hi, Greg One confusion. There are 5 kvm_arch_vcpu_create() while in this patch you changed 2 of them. Some particular reason? On Thu, Apr 21, 2016 at 04:20:53PM +0200, Greg Kurz wrote: >Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") >introduced a check to prevent pote

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-21 Thread Radim Krčmář
2016-04-21 18:45+0200, Greg Kurz: > On Thu, 21 Apr 2016 18:00:19 +0200 > Radim Krčmář wrote: >> 2016-04-21 16:20+0200, Greg Kurz: >> > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") >> > introduced a check to prevent potential kernel memory corruption in case >> > the v

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-21 Thread Greg Kurz
On Thu, 21 Apr 2016 18:00:19 +0200 Radim Krčmář wrote: > 2016-04-21 16:20+0200, Greg Kurz: > > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > > introduced a check to prevent potential kernel memory corruption in case > > the vcpu id is too great. > > > > Unfortunate

Re: [PATCH v4 2/2] KVM: move vcpu id checking to archs

2016-04-21 Thread Radim Krčmář
2016-04-21 16:20+0200, Greg Kurz: > Commit 338c7dbadd26 ("KVM: Improve create VCPU parameter (CVE-2013-4587)") > introduced a check to prevent potential kernel memory corruption in case > the vcpu id is too great. > > Unfortunately this check assumes vcpu ids grow in sequence with a common > diffe