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

Re: [PATCH] tools/ocaml/libs: Fix memory/resource leaks with caml_alloc_custom()




> On 1 Feb 2023, at 13:29, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> 
> All caml_alloc_*() functions can throw exceptions, and longjump out of
> context.  If this happens, we leak the xch/xce handle.
> 
> Reorder the logic to allocate the the Ocaml object first.
> 
> Fixes: 8b3c06a3e545 ("tools/ocaml/xenctrl: OCaml 5 support, fix 
> use-after-free")
> Fixes: 22d5affdf0ce ("tools/ocaml/evtchn: OCaml 5 support, fix potential 
> resource leak")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Christian Lindig <christian.lindig@xxxxxxxxxx>
> CC: David Scott <dave@xxxxxxxxxx>
> CC: Edwin Török <edwin.torok@xxxxxxxxx>
> CC: Rob Hoes <Rob.Hoes@xxxxxxxxxx>
> ---
> tools/ocaml/libs/eventchn/xeneventchn_stubs.c | 6 ++++--
> tools/ocaml/libs/xc/xenctrl_stubs.c           | 3 ++-
> 2 files changed, 6 insertions(+), 3 deletions(-)

Acked-by: Christian Lindig <christian.lindig@xxxxxxxxxx>




 


Rackspace

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