This is an archive of the discontinued LLVM Phabricator instance.

[DFSan] Handle fast16labels for all API functions.
ClosedPublic

Authored by morehouse on Jul 20 2020, 5:37 PM.

Details

Summary

Support fast16labels in dfsan_has_label, and print an error for all
other API functions.

Diff Detail

Event Timeline

morehouse created this revision.Jul 20 2020, 5:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2020, 5:37 PM
Herald added subscribers: Restricted Project, jfb. · View Herald Transcript
kcc added a comment.Jul 21 2020, 10:22 AM

I think this is an overkill.
fast16labels mode should be even simpler:
there are always 16 primary labels, they don't have any descriptions or properties controlled by dfsan.

compiler-rt/lib/dfsan/dfsan.cpp
258

I would just err in fast16labels mode w/i checking for last_lavel > 15.
Users should not call this function at all in fast16labels mode, IMO.

321

same

349

same

378

same

In D84215#2164676, @kcc wrote:

I think this is an overkill.
fast16labels mode should be even simpler:
there are always 16 primary labels, they don't have any descriptions or properties controlled by dfsan.

Seems reasonable, but note it will require effort for existing API users to switch. For example, all the existing protobuf labeling API, etc. will need to be adapted.

kcc added a comment.Jul 21 2020, 10:52 AM

and that's fine. I want this mode to be as simple as possible.

kcc added a comment.Jul 21 2020, 10:52 AM

Also, we don't have to err in these functions at all, it's fine to just return silently.

  • Print error on most API calls under fast16labels mode.
  • Update diffbase.
morehouse edited the summary of this revision. (Show Details)Jul 22 2020, 11:01 AM
morehouse marked 4 inline comments as done.
kcc accepted this revision.Jul 22 2020, 2:18 PM

LGTM

This revision is now accepted and ready to land.Jul 22 2020, 2:18 PM
This revision was automatically updated to reflect the committed changes.