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

Re: [Xen-devel] [Xen-users] Xen 4.2 TODO (io and irq parameter are not evaluated by xl)



On Fri, 2012-08-31 at 16:13 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-users] Xen 4.2 TODO (io and irq parameter are 
> not evaluated by xl)"):
> > libxl/xl: implement support for guest iooprt and irq permissions.
> 
> Most of this looks good, but:
> 
> ...                                       ("bios",             
> libxl_bios_type),
> > +            buf = xlu_cfg_get_listitem (ioports, i);
> > +            if (!buf) {
> > +                fprintf(stderr,
> > +                        "xl: Unable to get element #%d in ioport list\n", 
> > i);
> > +                exit(1);
> > +            }
> > +            s = e = strtoul(buf, &ep, 16);
> > +            if (ep == buf) {
> > +                fprintf(stderr, "xl: Invalid argument parsing ioport: 
> > %s\n",
> > +                        buf);
> > +                exit(1);
> > +            }
> > +            if (*ep == '-') {
> 
> This code fails to properly handle (reject)
>    - (*ep!=0 && *ep!='-')

Oops, will fix.

>    - value > LONG_MAX
>    - INT_MAX < value <= LONG_MAX

These all get checked inside the (eventual) hypercall. Or were you
thinking of something else?

BTW the types should be unsigned all the way down, unless I've screwed
something up.

>    - *ep2!=0

Will fix.

> 
> > +            irq = strtoul(buf, &ep, 10);
> 
> Likewise.
> 
> I take it we're not worrying about missing malloc failure checks in
> xl.

Seems like we do elsewhere, so I might as well fix this.

Ian.


_______________________________________________
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®.