This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Scudo thread specific data refactor, part 3
ClosedPublic

Authored by cryptoad on Sep 25 2017, 11:13 AM.

Details

Summary

Previous parts: D38139, D38183.

In this part of the refactor, we abstract the Linux vs Android TSD dissociation
in favor of a Exclusive vs Shared one, allowing for easier platform introduction
and configuration.

Most of this change consist of shuffling the files around to reflect the new
organization.

We introduce scudo_platform.h where platform specific definition lie. This
involves the TSD model and the platform specific allocator parameters. In an
upcoming CL, those will be configurable via defines, but we currently stick
with conservative defaults.

Event Timeline

cryptoad created this revision.Sep 25 2017, 11:13 AM
alekseyshl accepted this revision.Sep 25 2017, 2:11 PM
alekseyshl added inline comments.
lib/scudo/scudo_platform.h
20

... on this platform.

31

Maybe

#if SANITIZER_ANDROID || SANITIZER_FUCHSIA
  ...
#elif SANITIZER_LINUX && !SANITIZER_ANDROID
  ...
#else
  error
#endif

would be a bit more robust?

lib/scudo/scudo_tsd.h
58

const bool UnlockRequired;

65

Fix the comment, they are not platform specific anymore.

This revision is now accepted and ready to land.Sep 25 2017, 2:11 PM
cryptoad updated this revision to Diff 116617.Sep 25 2017, 2:35 PM
cryptoad marked 3 inline comments as done.

Addressing Aleksey's comments.

Unsubmitted inline response.

lib/scudo/scudo_tsd.h
58

I am not using a constructor but an init() function.
So const can't be used as UnlockRequired gets assigned.

dvyukov accepted this revision.Sep 26 2017, 12:17 AM
cryptoad closed this revision.Sep 26 2017, 10:21 AM