NFC: external_pointer address_cast earlier

Make it easier to justify our avoidance of capptr_from_client and
capptr_reveal in external_pointer by performing address_cast earlier.
In particular, with this change, we can see that the pointer (and so its
authority, in CHERI) is not passed to any called function other than
address_cast and pointer_offset, and so authority is merely propagated
and neither exercised nor amplified.

Remove the long-disused capptr_reveal_wild, which was added for earlier
versions of external_pointer.
This commit is contained in:
Nathaniel Wesley Filardo
2022-07-06 10:40:35 +01:00
committed by Nathaniel Filardo
parent db3ae1c8e3
commit 09bc0c6be7
3 changed files with 26 additions and 26 deletions

View File

@@ -476,7 +476,7 @@ void test_remaining_bytes()
char* p = (char*)alloc.alloc(size);
for (size_t offset = 0; offset < size; offset++)
{
auto rem = alloc.remaining_bytes(p + offset);
auto rem = alloc.remaining_bytes(address_cast(pointer_offset(p, offset)));
if (rem != (size - offset))
{
printf(