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

Re: [Xen-devel] [PATCH] ocaml/xenctrl: Fix stub_xc_readconsolering()



On Fri, 2015-01-30 at 14:30 +0000, Dave Scott wrote:
> 
> 
> > On 30 Jan 2015, at 14:11, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> > 
> > The Ocaml stub to retrieve the hypervisor console ring had a few problems.
> > 
> > * A single 32k buffer would truncate a large console ring.
> > * The buffer was static and not under the protection of the Ocaml GC lock so
> >   could be clobbered by concurrent accesses.
> > * Embedded NUL characters would cause caml_copy_string() (which is strlen()
> >   based) to truncate the buffer.
> > 
> > The function is rewritten from scratch, using the same algorithm as the 
> > python
> > stubs, but uses the protection of the Ocaml GC lock to maintain a static
> > running total of the ring size, to avoid redundant realloc()ing in future
> > calls.
> > 
> 
> As far as the OCaml FFI goes, this looks fine to me. I canât spot any
> problems with the more regular C parts either, although someone who is
> more used to spotting bugs in C code should probably take a look.

It looks ok to me and the fact it is based on some existing code helps
too.

> Acked-by: David Scott <dave.scott@xxxxxxxxxx>

likewise + applied.

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