@@ -5,17 +5,19 @@ rely on from all CHERI-enabled allocators.
55
66### Allocating memory
77
8- Calls to ` malloc() ` and ` calloc() ` must return capabilities that:
8+ Calls to ` malloc() ` , ` calloc() ` , and ` posix_memalign() ` must either return a
9+ capability holding a ` NULL ` pointer (on failure), or a capability holding a
10+ non-` NULL ` pointer (on success) that is:
911
10- * Are valid (i.e., with its tag bit set)
11- * Are unsealed
12- * Have bounds that permit access to the full requested memory range of the
12+ * Valid (i.e., with its tag bit set)
13+ * Unsealed
14+ * Has bounds that permit access to the full requested memory range of the
1315 allocation
14- * Have bounds that do not permit access to any other current allocation, nor
16+ * Has bounds that do not permit access to any other current allocation, nor
1517 to allocator metadata, implementing non-aliasing spatial safety
16- * Have permissions that allow data load, data store, capability load, and
18+ * Has permissions that allow data load, data store, capability load, and
1719 capability store
18- * Are sufficiently aligned to allow capability loads and stores at relative
20+ * Is sufficiently aligned to allow capability loads and stores at relative
1921 offset 0 from the returned pointer
2022
2123The allocator may:
@@ -28,14 +30,13 @@ The allocator may:
2830
2931### Freeing memory
3032
31- The caller must not pass as an argument to ` free() ` a capability that:
33+ The caller must pass either a ` NULL ` pointer via a capability argument to
34+ ` free() ` , or a non-` NULL ` capability that:
3235
33- * Is invalid (i.e., without its tag bit set)
34- * Is sealed
35- * Has bounds other than those on the original capability returned by
36- ` malloc() ` , ` calloc() ` , or ` realloc() `
37- * Has permissions that differ from those on the original capability returned
38- by ` malloc() ` , ` calloc() ` , or ` realloc() `
36+ * Is valid (i.e., with its tag bit set)
37+ * Is unsealed
38+ * Has address, bounds, and permissions identical to those on the original
39+ capability returned by ` malloc() ` , ` calloc() ` , or ` realloc() `
3940
4041The allocator must not:
4142
@@ -47,7 +48,7 @@ The allocator may:
4748 * Fill reachable memory within the bounds of the allocation with zeroes after
4849 it has been freed
4950 * On virtual-memory-enabled systems, unmap reachable memory within the bounds
50- of the allocation after it has been freed.
51+ of the allocation after it has been freed
5152 * Revoke capabilities to the storage immediately upon free
5253
5354If utilizing revocation, the allocator must:
0 commit comments