[PATCH] D56125: [Sanitizer] Intercept arc4random_buf on FreeBSD/NetBSD

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 28 05:18:01 PST 2018


devnexen marked 2 inline comments as done.
devnexen added inline comments.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:9092
+  COMMON_INTERCEPTOR_ENTER(ctx, arc4random_buf, buf, len);
+  if (buf && len)
+    COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, len);
----------------
krytarowski wrote:
> According to my code reading.. `arc4random_buf` only outputs the buffer, it does not read it.
No what just an "extra" precaution for the input to see if it is valid, but will remove it.


================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:9099
+
+INTERCEPTOR(void, arc4random_addrandom, u64 *dat, int datlen) {
+  void *ctx;
----------------
devnexen wrote:
> krytarowski wrote:
> > u64 -> unsigned char
> Obvious typo. Will fix it
Yes exactly what I meant.


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

https://reviews.llvm.org/D56125





More information about the llvm-commits mailing list