[PATCH] D44713: Unsubmitted part of D44599

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 13:23:21 PDT 2018


vitalybuka requested changes to this revision.
vitalybuka added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:1754
+#if SANITIZER_OPENBSD
+  *pc = 0;
+  *bp = 0;
----------------
vitalybuka wrote:
> 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>.
Could you please comment about your plans here?


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:325
   struct stat64 buf64;
-  int res = internal_syscall(SYSCALL(stat64), path, &buf64);
+  int res = internal_syscall_ptr(SYSCALL(stat64), path, &buf64);
   stat64_to_stat(&buf64, (struct stat *)buf);
----------------
I think it should be internal_syscall() as it's int everywhere, why do you need ptr?
And this is not OpenBSD branch at all


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:395
 #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS || SANITIZER_OPENBSD
-  return internal_syscall(SYSCALL(readlinkat), AT_FDCWD, (uptr)path, (uptr)buf,
-                          bufsize);
+  return internal_syscall_ptr(SYSCALL(readlinkat), AT_FDCWD, (uptr)path,
+                              (uptr)buf, bufsize);
----------------
On linux readlinkat is int, on OpenBSD it's size. So it should be two different branches


================
Comment at: lib/sanitizer_common/sanitizer_linux.cc:412
 #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS || SANITIZER_OPENBSD
-  return internal_syscall(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath, AT_FDCWD,
-                          (uptr)newpath);
+  return internal_syscall_ptr(SYSCALL(renameat), AT_FDCWD, (uptr)oldpath,
+                              AT_FDCWD, (uptr)newpath);
----------------
it's int on OpenBSD as well https://github.com/openbsd/src/blob/master/sys/sys/syscall.h


https://reviews.llvm.org/D44713





More information about the llvm-commits mailing list