[PATCH] [msan] Intercept *getxattr and *listxattr.

Evgeniy Stepanov eugenis at google.com
Wed Jan 29 01:04:53 PST 2014


  You need to update tsan_stat.h and tsan_stat.cc. Run check-tsan to verify.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:3074
@@ +3073,3 @@
+  COMMON_INTERCEPTOR_ENTER(ctx, listxattr, path, list, size);
+  COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path));
+  SSIZE_T res = REAL(listxattr)(path, list, size);
----------------
if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:3076
@@ +3075,3 @@
+  SSIZE_T res = REAL(listxattr)(path, list, size);
+  if (res >= 0) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, list, size);
+  return res;
----------------
if (res  > 0 && list)

size => res


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



More information about the llvm-commits mailing list