[PATCH] Sanitize printf functions

Evgeniy Stepanov eugenis at google.com
Fri Dec 27 03:51:56 PST 2013



================
Comment at: asan/asan_interceptors.cc:678
@@ +677,3 @@
+#if ASAN_INTERCEPT_PRINTF
+// TODO(ygribov): move to sanitizer_common_interceptors.inc
+// to reuse in e.g. other sanitizers?
----------------
Kostya Serebryany wrote:
> Yury Gribov wrote:
> > Kostya Serebryany wrote:
> > > yes, please
> > I tried this initially but realized that Msan already intercepts printf stuff. What's the general policy about what goes into sanitizer_common (e.g. strcmp) and what gets re-implemented in each sanitizer (e.g. memset)?
> msan interceptors are rudimentary and will have to be replaced with these *eventually*.
> Here is a suggestion: move the code to sanitizer_common_interceptors.inc
> but define  SANITIZER_INTERCEPT_PRINTF to 1 only in asan.
> tsan and msan will follow later.
We can enable it in MSan from the start (killing the old msan interceptors), just make sure that the new interceptors emulate a WRITE to the target buffer (for sprintf and friends).


http://llvm-reviews.chandlerc.com/D2480



More information about the llvm-commits mailing list