[PATCH] [sanitizer] Syscall hooks

Evgeniy Stepanov eugenis at google.com
Thu Apr 11 07:19:00 PDT 2013


  Thanks, I've addressed your comments, please take another look.


================
Comment at: include/sanitizer/linux_syscalls.h:21
@@ +20,3 @@
+
+void __sanitizer_syscall_pre_rt_sigpending(void *p, size_t s);
+void __sanitizer_syscall_pre_getdents(int fd, void *dirp, int count);
----------------
Alexander Potapenko wrote:
> Perhaps the pre and post declarations can be generated using a single macro?
> That's more readable and less error-prone.
I'd prefer not too, it would obscure the function name.

================
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
----------------
Alexey Samsonov wrote:
> kernel will write to
kernel will write to and must be addressable ?

================
Comment at: lib/sanitizer_common/sanitizer_common_syscalls.inc:31
@@ +30,3 @@
+#define PRE_SYSCALL(name) SANITIZER_INTERFACE_ATTRIBUTE \
+  void __sanitizer_syscall_pre_##name
+#define PRE_READ(p, s) COMMON_SYSCALL_PRE_READ_RANGE(p, s)
----------------
Alexander Potapenko wrote:
> 4-spaces indentation.
clang-format did something else entirely


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



More information about the llvm-commits mailing list