cheri-c-programming icon indicating copy to clipboard operation
cheri-c-programming copied to clipboard

Discourage use of tags to implement logic

Open kwitaszczyk opened this issue 2 years ago • 1 comments

Tags could be seen as an interesting feature to implement logic that behaves differently depending on whether a pointer or an integer value was passed to a function. This triggers two issues:

  1. Relying on tags to distinguish pointers from integer values does not distinguish valid and invalid pointers, and it's simply invalid.
  2. Relying on tags makes it harder to upstream changes.

The document should make a developer aware of consequences of such decision.

kwitaszczyk avatar Apr 28 '23 14:04 kwitaszczyk

It also violates the principle of intentional use (one of the two underlying principles of CHERI).

bsdjhb avatar Apr 28 '23 19:04 bsdjhb