From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW5sC-0001mk-Hk for qemu-devel@nongnu.org; Mon, 13 Jun 2011 08:04:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW5sB-0000GK-DQ for qemu-devel@nongnu.org; Mon, 13 Jun 2011 08:04:04 -0400 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]:45105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW5sB-0000Fu-3Z for qemu-devel@nongnu.org; Mon, 13 Jun 2011 08:04:03 -0400 Message-ID: <4DF5FC9C.4050701@st.com> Date: Mon, 13 Jun 2011 14:03:40 +0200 From: Laurent Alfonsi MIME-Version: 1.0 References: <1306928551-31723-1-git-send-email-cedric.vincent@st.com> <4DE63DF1.60709@twiddle.net> <20110601134734.GA10150@gnx2503> <4DE65BE3.1040004@twiddle.net> <20110603064619.GA7025@gnx2503> In-Reply-To: <20110603064619.GA7025@gnx2503> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user: Define AT_RANDOM to support target dynamic linkers that do ASLR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cedric VINCENT Cc: Riku Voipio , "qemu-devel@nongnu.org" , Richard Henderson >> 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.