Collin Funk wrote:
> Thanks for checking. I pushed the attached patch with those changes.

Thanks.

> I assumed uintptr_t was correct for performing arithmetic on any
> pointer. I know CHERI has some limitations, but I am not familiar with
> them. Perhaps I will get around to reading the manual at some point [1].

Long story short: Modern hardware extensions add extra information into
a pointer, such as bounds or a cryptographically secure signature. When
you add an offset to a pointer, these extra fields remain unchanged.
When you convert a pointer to an uintptr_t and back, these fields are
revalidated. You can assume that the CPU contains some caches for
optimizing this revalidation away in most cases (otherwise the processing
would be too slow). But when converting an uintptr_t to a pointer, some
of these optimizations don't apply.

Bruno




Reply via email to