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

[PATCH 0/7] tools/ocaml: Memory corruption fixes in bindings


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 31 Jan 2023 21:29:06 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, David Scott <dave@xxxxxxxxxx>, Edwin Török <edwin.torok@xxxxxxxxx>, Rob Hoes <Rob.Hoes@xxxxxxxxxx>
  • Delivery-date: Tue, 31 Jan 2023 21:29:40 +0000
  • Ironport-data: A9a23:GnY/TaO4PKcnpcDvrR2kl8FynXyQoLVcMsEvi/4bfWQNrUp03jQEm mZOWWmHbv7eMzOkfY9xaoWxoBhQ65HQzdMwGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQA+KmU4YoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGj9Suv3rRC9H5qyo42tB5QVmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0s9vJDl8s t4GESkEYxyn3L6f8oCqc8A506zPLOGzVG8eknRpzDWfBvc6W5HTBa7N4Le03h9p2JoIR6yHI ZNEN3w2Nk+ojx5nYz/7DLoXmuuyi2a5WDpfsF+P/oI84nTJzRw327/oWDbQUo3XGZQExxnHz o7A10CnBiEfDfGk9SGI3Sy0rf7+kBOlVJ1HQdVU8dY12QbOlwT/EiY+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WA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KRnGY46ML+K40H2MGDx2VipUCHaPbBCP2iIp4/84b0z6u3vcJsUzIEqkJ CEVF9Dr2Y9d0/nFMXLhfRwg2bwaXT4WS6oxtBV5pB/tLG5TL33MTebQFRrl8e7uf0QDsDSRv 72MpNLBP3oK3foBO9yrnrDcogXLWNbXNweu949VV7LqsXXKpfyvuiea/rXLKqFK0dWZoo+OA pyYNHeHrQw0qnwYA6GvPH4YQKSRnDC
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

It turns out there have been some latent memory corruption bugs and other
errors in the bindings since they were first introduced.

These were discovered after realising that we'd introduced other memory
corruption bugs as part of the Ocaml 5 fixes, and in the case of the evtchn
bindings, backported this as part of the oxenstored-lu fixes.

This series addresses all the memory corrupution issues we're aware of that
can occur in an entirely well-formed program.

Deferred for now are the (hopefully latent) memory corruption errors which
happen due to bad parameter passing, and a substantial pile of related cleanup.

Andrew Cooper (3):
  tools/ocaml/libs: Allocate the correct amount of memory for Abstract_tag
  tools/ocaml/evtchn: Misc cleanup
  tools/ocaml/xc: Don't reference Abstract_Tag objects with the GC lock released

Edwin Török (4):
  tools/ocaml/libs: Don't declare stubs as taking void
  tools/ocaml/evtchn: Don't reference Custom objects with the GC lock released
  tools/ocaml/xc: Fix binding for xc_domain_assign_device()
  tools/ocaml/xc: Don't reference Custom objects with the GC lock released

 tools/ocaml/libs/eventchn/xeneventchn_stubs.c |  89 ++---
 tools/ocaml/libs/mmap/Makefile                |   2 +
 tools/ocaml/libs/mmap/xenmmap_stubs.c         |   6 +-
 tools/ocaml/libs/xb/xenbus_stubs.c            |   5 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c           | 494 ++++++++++++++------------
 5 files changed, 323 insertions(+), 273 deletions(-)

-- 
2.11.0




 


Rackspace

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