[PATCH] D55167: Add a new interceptors for cdbr(3) and cdbw(3) API from NetBSD
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 4 00:27:59 PST 2018
vitalybuka 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));
----------------
could you please extract this with comment and similar for write into functions?
================
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
----------------
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
================
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);
+ }
----------------
function?
================
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);
----------------
Please extract functions here for structs as well.
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