[PATCH] D41620: [msan] Intercept sendmmsg, recvmmsg.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 18:33:08 PST 2018


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:2860
+    if (fd >= 0) COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd);
+    for (int i = 0; i < res; ++i) {
+      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &msgvec[i].msg_len,
----------------
Do you need to check read first?
COMMON_INTERCEPTOR_READ_RANGE(ctx, msgvec,
                                                                            sizeof(*msgvec);


================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:2956
+  if (res >= 0 && msgvec)
+    for (int i = 0; i < res; ++i) {
+      COMMON_INTERCEPTOR_WRITE_RANGE(ctx, &msgvec[i].msg_len,
----------------
same here


https://reviews.llvm.org/D41620





More information about the llvm-commits mailing list