[PATCH] D55167: Add a new interceptors for cdbr(3) and cdbw(3) API from NetBSD

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 12:03:09 PST 2018


krytarowski marked 8 inline comments as done.
krytarowski added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7421
+    // other pointers like hash_base, offset_base and data_base
+    // are calculated from the mmap_base
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, cdbr, sizeof(*cdbr));
----------------
vitalybuka wrote:
> could you please extract this with comment and similar for write into functions?
it has been simplified, we no longer sanitize internals of opaque cdbr/cdbw struct.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7442
+  if (cdbr) {
+    // other pointers like hash_base, offset_base and data_base
+    // are calculated from the mmap_base
----------------
vitalybuka wrote:
> for WRITE maybe we can assume that system sets *base correctly.
> however for READ, we don't know if values are corrupted, so it would be nice to be check them for shaddow, or just check that they point into the mmap_base
it has been simplified, we no longer sanitize internals of opaque cdbr/cdbw struct.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7456
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ret, sizeof(*ret));
+    COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ret->hash, ret->hash_size);
+  }
----------------
vitalybuka wrote:
> function?
it has been simplified, we no longer sanitize internals of opaque cdbr/cdbw struct.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:7515
+  if (cdbw) {
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, cdbw, sizeof(*cdbw));
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, cdbw->hash, cdbw->hash_size);
----------------
vitalybuka wrote:
> Please extract functions here for structs as well.
it has been simplified, we no longer sanitize internals of opaque cdbr/cdbw struct.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55167/new/

https://reviews.llvm.org/D55167





More information about the llvm-commits mailing list