qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Define AT_RANDOM to support target


From: Laurent Alfonsi
Subject: Re: [Qemu-devel] [PATCH] linux-user: Define AT_RANDOM to support target dynamic linkers that do ASLR
Date: Mon, 13 Jun 2011 14:03:40 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

         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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]