tools/ocaml/libs/xb: Do not crash after xenbus is unmapped
authorEdwin Török <edvin.torok@citrix.com>
Fri, 15 Jan 2021 18:23:10 +0000 (18:23 +0000)
committerIan Jackson <iwj@xenproject.org>
Fri, 19 Mar 2021 13:43:29 +0000 (13:43 +0000)
commit78a22dee01f24974448e79774d1e48338b4846d0
treefb911cd55b587f6c9132e2cb2ed1d54512b53243
parent9503a6df19924d2d9bf5b5a663342ba1507819c5
tools/ocaml/libs/xb: Do not crash after xenbus is unmapped

Xenmmap.unmap sets the address to MAP_FAILED in xenmmap_stubs.c.  If due to a
bug there were still references to the Xenbus and we attempt to use it then we
crash.  Raise an exception instead of crashing.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
(cherry picked from commit 5e317896342d553f0b55f72948bbf93a0f1147d3)
tools/ocaml/libs/xb/xs_ring_stubs.c