Skip to content

Conversation

@brooksdavis
Copy link
Member

These functions take the source or destintation address indirectly from
a potentially missaligned buffer.  Rename them to refect this and to
free up the copy{in,out}ptr names.

Some of the code in question is dead code and doesn't or won't compile,
but I've changed it all for consistency.

NB: If the pointers are actually stored under aligned then this code is
broken with CHERI.
Rename the __USER_CAP macros to USER_PTR.  This reflects our
desire to talk about pointers when ever possible rather than
capabilities.
Rename all variants of copy{in,out}cap to copy{in,out}ptr.  This
reflects our desire to talk about pointers when ever possible rather
than capabilities.
Copy link
Collaborator

@bsdjhb bsdjhb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me

.Fn copyoutptr_nofault
functions must be used when copying data which may contain pointers and
they may be used anywhere,
but they should be used only when necessicary to limit the numeber of
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
but they should be used only when necessicary to limit the numeber of
but they should be used only when necessary to limit the number of

and
.Fn copyoutptr_nofault
functions must be used when copying data which may contain pointers and
they may be used anywhere,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be tempted to drop "and they may be used anywhere", and just say "must be used when copying data which contains pointers, but they should only be used when necessary..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants