[PATCH] D54076: Add interceptors for the sysctl(3) API family from NetBSD

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 13:40:25 PST 2018


vitalybuka added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7283
+  if (sname)
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, sname, REAL(strlen)(sname) + 1);
+  res = REAL(sysctlbyname)(sname, oldp, oldlenp, newp, newlen);
----------------
Why you don't check newp here?


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7303
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, sname, REAL(strlen)(sname) + 1);
+  // Skip rnode, it's rarely used and not trivial to sanitize
+  // It's also used mostly internally
----------------
READ from namelenp?
same bellow


================
Comment at: test/sanitizer_common/TestCases/NetBSD/sysctl.cc:101
+  // CHECK: sysctl
+  // CHECK: OSTYPE: '{{.*}}'
+  // CHECK: OSTYPE: '{{.*}}'
----------------
Can you please use different prefixies in printfs so make reading errors easier?


Repository:
  rL LLVM

https://reviews.llvm.org/D54076





More information about the llvm-commits mailing list