[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [Patch v2 3/3] xen/gdbsx: Security audit of {, un}pausevcpu and domstatus hypercalls



On Thu, 24 Jul 2014 14:02:43 +0100
Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:

> On 24/07/14 13:58, Jan Beulich wrote:
> >>>> On 24.07.14 at 13:16, <andrew.cooper3@xxxxxxxxxx> wrote:
> >> --- a/xen/arch/x86/domctl.c
> >> +++ b/xen/arch/x86/domctl.c
> >> @@ -1030,11 +1030,10 @@ long arch_do_domctl(
> >>          if ( !d->controller_pause_count )
> >>              break;
> >>          ret = -EINVAL;
> >> -        if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= MAX_VIRT_CPUS
> >> ||
> >> +        if ( domctl->u.gdbsx_pauseunp_vcpu.vcpu >= d->max_vcpus ||
> > As mentioned on IRC - are you sure you can replace (rather than
> > amend) the previous bounds check? I.e. do you _know_ that gdbsx
> > can deal with guests having more than MAX_VIRT_CPUS vCPU-s?
> >
> > Jan
> >
> 
> I have no idea whether it can or not, but if it asks for a legitimate
> ID greater than MAX_VIRT_CPUS, then I think it is reasonable to
> assume yes.

In earlier days, gdbsx was not part of xen. So I, in my earlier xen
days, added call to unpause a vcpu with INTMAX (~0u) vcpuid, and see
if xen returns ENOSYS. 

The above change doesn't affect that, and it is good to check for
d->max_vcpus instead of MAX_VIRT_CPUS.

vcpuid in gdbsx is int, so it can handle INTMAX-1 vcpus, it thinks
INTMAX is invalid vcpu :).

thanks,
mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.