[PATCH] D17479: [sanitizer] Move recvmsg and recv interceptors to sanitizer_common.

Maxim Ostapenko via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 06:09:21 PST 2016


m.ostapenko added inline comments.

================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:5359
@@ +5358,3 @@
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, len);
+    COMMON_INTERCEPTOR_UNPOISON_PARAM(5);
+  }
----------------
dvyukov wrote:
> this is different from what msan did
> why?
You are right. This is msan specific code, so perhaps we could wrap the whole if to macro (say, COMMON_INTERCEPTOR_UNPOISON_COND) and define it like this:
```
#define COMMON_INTERCEPTOR_UNPOISON_COND(srcaddr, sz, srcaddr_sz)  \
  do {                                                             \
    if (srcaddr) {                                                 \
      SIZE_T sz = *addrlen;                                        \
        __msan_unpoison(srcaddr, Min(sz, srcaddr_sz));             \
    }                                                              \
  } while (false)
```
for msan and empty macros for others (just like COMMON_INTERCEPTOR_UNPOISON_PARAM)?


Repository:
  rL LLVM

http://reviews.llvm.org/D17479





More information about the llvm-commits mailing list