[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 06:25:52 PST 2018
devnexen marked an inline comment as done.
devnexen added inline comments.
================
Comment at: test/sanitizer_common/TestCases/Posix/arc4random.cc:18
+ for (auto i = 0; i < sizeof(buf); i ++)
+ printf("%" PRIx8, buf[i]);
+ printf("'\n");
----------------
krytarowski wrote:
> Maybe we want to cast buf[i] to (unsigned char) due to int promotion rules.
>
> Please add calls of arc4random, arc4random_uniform, arc4random_stir in the tests too, just in case that would trigger interceptors inside libc and cause false positives.
>
> This might make harm on NetBSD, as there are installed interceptors for functions like `SHA256_Update`.
>
> Can you also add two types of tests with a short buffer (like 10 elements) and another with 128 elements? There are used different algorithms internally at least on NetBSD for each case.
Sure, good ideas . Worth a shot.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56125/new/
https://reviews.llvm.org/D56125
More information about the llvm-commits
mailing list