diff options
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_syscalls.inc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_common_syscalls.inc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_syscalls.inc b/lib/sanitizer_common/sanitizer_common_syscalls.inc index 753f80fa1..a0de10414 100644 --- a/lib/sanitizer_common/sanitizer_common_syscalls.inc +++ b/lib/sanitizer_common/sanitizer_common_syscalls.inc @@ -74,23 +74,26 @@ PRE_SYSCALL(recvmsg)(int sockfd, struct sanitizer_kernel_msghdr *msg, POST_SYSCALL(recvmsg)(long res, int sockfd, struct sanitizer_kernel_msghdr *msg, int flags) { if (res > 0) - for (unsigned long i = 0; i < msg->msg_iovlen; ++i) + for (unsigned long i = 0; i < msg->msg_iovlen; ++i) { POST_WRITE(msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len); + } POST_WRITE(msg->msg_control, msg->msg_controllen); } PRE_SYSCALL(rt_sigpending)(void *p, unsigned long s) { PRE_WRITE(p, s); } POST_SYSCALL(rt_sigpending)(long res, void *p, unsigned long s) { - if (res == 0) + if (res == 0) { POST_WRITE(p, s); + } } PRE_SYSCALL(getdents)(int fd, void *dirp, int count) { PRE_WRITE(dirp, count); } POST_SYSCALL(getdents)(long res, int fd, void *dirp, int count) { - if (res > 0) + if (res > 0) { POST_WRITE(dirp, res); + } } PRE_SYSCALL(getdents64)(int fd, void *dirp, int count) { @@ -98,36 +101,43 @@ PRE_SYSCALL(getdents64)(int fd, void *dirp, int count) { } POST_SYSCALL(getdents64)(long res, int fd, void *dirp, int count) { - if (res > 0) + if (res > 0) { POST_WRITE(dirp, res); + } } PRE_SYSCALL(wait4)(int pid, int *status, int options, struct sanitizer_kernel_rusage *r) { - if (status) + if (status) { PRE_WRITE(status, sizeof(*status)); - if (r) + } + if (r) { PRE_WRITE(r, sizeof(*r)); + } } POST_SYSCALL(wait4)(long res, int pid, int *status, int options, struct sanitizer_kernel_rusage *r) { if (res > 0) { - if (status) + if (status) { POST_WRITE(status, sizeof(*status)); - if (r) + } + if (r) { POST_WRITE(r, sizeof(*r)); + } } } PRE_SYSCALL(waitpid)(int pid, int *status, int options) { - if (status) + if (status) { PRE_WRITE(status, sizeof(*status)); + } } POST_SYSCALL(waitpid)(long res, int pid, int *status, int options) { - if (res > 0 && status) + if (res > 0 && status) { POST_WRITE(status, sizeof(*status)); + } } } // extern "C" |