CTSRD-CHERI / cheri-c-programming

CHERI C/C++ Programming Guide
28 stars 3 forks source link

More structured specification for memory-allocator APIs #23

Open rwatson opened 2 years ago

rwatson commented 2 years ago

Currently, we describe some practical implementation implications for allocators -- e.g., relating to bounds alignment -- but ideally we'd actually have a higher-level section talking in rather more detail about requirements for memory allocators. This would include not just how to do alignment/bounds, but also what sanity checks to run when free()/realloc()/etc are called, expectations (perhaps) for memory clearing, and to some extent (unclear how much) integration with VM. Might also want to touch on topics such as slab allocators.

This relates to existing issues #9 and #17 (the latter possibly subsumed by this issue?).

rwatson commented 2 years ago

I guess also this would include some guidance (not sure how strong on the 'may' 'should' 'most' spectrum) along the lines of return values when allocating zero-size regions, how to handle bounds in those edge cases, and so on.

rwatson commented 2 years ago

It might also be that we want to consider how to handle optional types of protection -- e.g., at least "No temporal safety" vs "With temporal safety" -- but the latter might be subdivided into addressing issues like multiple frees / sanity checking vs support requiring actual revocation.

rwatson commented 2 years ago

Tagging @brettferdosi, @brooksdavis