unsigned char k_rand_bytes[16];
elf_addr_t __user *u_rand_bytes;
...
/*
* Generate 16 random bytes for userspace PRNG seeding.
*/
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));
u_rand_bytes = (elf_addr_t __user *)
STACK_ALLOC(p, sizeof(k_rand_bytes));
if (__copy_to_user(u_rand_bytes, k_rand_bytes, sizeof(k_rand_bytes)))
return -EFAULT;
...
NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes);
It's clearer to me now, thanks.
It is fine with me, I also understand better now.
And this now brings me to another point : In that case, it might have
sense to also add the auxv AT_RANDOM_SIZE.
http://sources.redhat.com/ml/libc-alpha/2008-10/msg00016.html
I suggest at minimum a command-line argument to force a
particular AT_RANDOM value, for repeatability.
Yep, I agree.
Laurent.