[PATCH] D44713: Unsubmitted part of D44599

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 11:03:44 PDT 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:72
 #include <sys/futex.h>
+extern char **environ;
 #endif
----------------
devnexen wrote:
> devnexen wrote:
> > vitalybuka wrote:
> > > this should not be needed after r328077
> > I commented this commit [[ https://reviews.llvm.org/rL327904 |here]]
> Nice works better under FreeBSD should do the job under OpenBSD.
Sorry, that was a typo.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:341
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf,
                           AT_SYMLINK_NOFOLLOW);
----------------
devnexen wrote:
> vitalybuka wrote:
> > What about this?
> I thought I did this one ...
Sorry, but I only asked, because I am not sure why you are making this change.
According sanitizer_common/sanitizer_syscall_generic.inc 
>> internal_syscall_ptr for pointer and (s)size_t

Looking on documentation all of them return int and internal_syscall supposed to be used. What am I missing?


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1754
+#if SANITIZER_OPENBSD
+  *pc = 0;
+  *bp = 0;
----------------
devnexen wrote:
> vitalybuka wrote:
> > Why zeroes? Can you get real values?
> ucontext not supported here.
https://man.openbsd.org/sigaction.2
>> On OpenBSD, ucontext_t is an alias for the sigcontext structure defined in <signal.h>.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:311
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
-  return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path, (uptr)buf,
-                          0);
+  return internal_syscall_ptr(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
+                              (uptr)buf, 0);
----------------
newfstatat should return int, so no _ptr


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:317
   struct kernel_stat kbuf;
-  int res = internal_syscall(SYSCALL(stat), path, &kbuf);
+  int res = internal_syscall_ptr(SYSCALL(stat), path, &kbuf);
   kernel_stat_to_stat(&kbuf, (struct stat *)buf);
----------------
same for stat


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:404
 #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS || SANITIZER_OPENBSD
-  return internal_syscall(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0);
+  return internal_syscall_ptr(SYSCALL(unlinkat), AT_FDCWD, (uptr)path, 0);
 #else
----------------
same for unlinkat, it returns int, on both



https://reviews.llvm.org/D44713





More information about the llvm-commits mailing list