I am on Linux that has address space allocation randomization. Is it necessary to declare a buffer on the stack, leave it uninitialized and use it for entropy, or can I just take the address of something already on the stack, apply it to an integer and (knowing that it is somewhat random due to solving the randomization problem of the place placement), use this integer for entropy instead?
The pointer approach has the advantage that it does not generate any compiler warnings, since the unified buffer does this when trying to manipulate it, but in my tests it seemed only the bottom of the address (maybe the last byte or two) will change from call to call. The entropy buffer seemed even worse, often containing nothing.
source
share