[PATCH] [sanitizer] Syscall hooks

Alexey Samsonov samsonov at google.com
Thu Apr 11 06:39:50 PDT 2013



================
Comment at: lib/sanitizer_common/sanitizer_common_syscalls.inc:112
@@ +111,3 @@
+
+}
+
----------------
}  // extern "C"

================
Comment at: lib/msan/lit_tests/Linux/syscalls.cc:18
@@ +17,3 @@
+  __sanitizer_syscall_pre_recvmsg(0, (struct sanitizer_kernel_msghdr *)buf, 0);
+  __sanitizer_syscall_pre_rt_sigpending((void *)buf, 10);
+  __sanitizer_syscall_pre_getdents(0, (struct sanitizer_kernel_dirent *)buf,
----------------
Please use a named constant for 10

================
Comment at: lib/msan/lit_tests/Linux/syscalls.cc:11
@@ +10,3 @@
+#include <sanitizer/msan_interface.h>
+#include <sanitizer/linux_syscalls.h>
+
----------------
Alexander Potapenko wrote:
> Mind the order of includes.
Please add a comment on the purpose of this test. We will likely extend it

================
Comment at: include/sanitizer/linux_syscalls.h:12
@@ +11,3 @@
+//
+// System call handlers.
+//===----------------------------------------------------------------------===//
----------------
Please add a comment on how this header should be used.

================
Comment at: lib/sanitizer_common/sanitizer_common_syscalls.inc:19
@@ +18,3 @@
+//   COMMON_SYSCALL_PRE_WRITE_RANGE
+//          Called in prehook for regions that will be written to by the kernel
+//          and must be addressable. The actual write range may be smaller than
----------------
kernel will write to

================
Comment at: lib/sanitizer_common/sanitizer_common_syscalls.inc:26
@@ +25,3 @@
+//   COMMON_SYSCALL_POST_WRITE_RANGE
+//          Called in posthook for regions that were written to by the kernel
+//          and are now initialized.
----------------
kernel wrote to


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



More information about the llvm-commits mailing list