AFAICT compiler-rt doesn't have a function that would return 'good' random
bytes to seed a PRNG. Currently, the SizeClassAllocator64 uses addresses
returned by mmap to seed its PRNG, which is not ideal, and
SizeClassAllocator32 doesn't benefit from the entropy offered by its 64-bit
counterpart address space, so right now it has nothing. This function aims at
solving this, allowing to implement good 32-bit chunk randomization. Scudo also
has a function that does this for Cookie purposes, which would go away in a
later CL once this lands.
This function will try the getrandom syscall if available, and fallback to
/dev/urandom if not.
Unfortunately, I do not have a way to implement and test a Mac and Windows
version, so those are unimplemented as of now. Note that kRandomShuffleChunks
is only used on Linux for now.
Why u8*? Why not customary void*?