> On 1 Feb 2023, at 13:29, Andrew Cooper <andrew.coop...@citrix.com> 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.coop...@citrix.com>
> ---
> CC: Christian Lindig <christian.lin...@citrix.com>
> CC: David Scott <d...@recoil.org>
> CC: Edwin Török <edwin.to...@cloud.com>
> CC: Rob Hoes <rob.h...@citrix.com>
> ---
> 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.lin...@citrix.com>


Reply via email to