[PATCH] D42546: [scudo] Overhaul malloc related interceptors

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 09:16:55 PST 2018


cryptoad created this revision.
cryptoad added a reviewer: alekseyshl.
Herald added subscribers: Sanitizers, delcypher, hintonda, mgorny.

This is a follow-up to https://reviews.llvm.org/D42506.

There are a few of things that bothered me about `scudo_interceptors.cpp`:

- the filename is a misnomer: it intercepts some functions, but the rest (C++) is actually in `scudo_new_delete.cpp`. I feel like `scudo_malloc.cpp` is more appropriate (ASan uses the same naming scheme);
- we do not need "full" interceptors, since we are never accessing the unsanitized version of the functions, we just need the `extern "C" INTERCEPTOR_ATTRIBUTE` part of it to just call our functions;
- a couple of functions where duplicated while they could just be `ALIAS`'d;
- use the `SANITIZER_INTERCEPT_*` defines to hide the unneeded interceptors;
- use `SIZE_T` instead of `uptr`: while it's the same behind the curtain, the former is meant for this use case.

In the end there is no functional change on the currently supported platforms
(Linux, Android).


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D42546

Files:
  lib/scudo/CMakeLists.txt
  lib/scudo/scudo_interceptors.cpp
  lib/scudo/scudo_malloc.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42546.131467.patch
Type: text/x-patch
Size: 5408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180125/91fbd91e/attachment.bin>


More information about the llvm-commits mailing list