lkml.org 
[lkml]   [2008]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ELF: implement AT_RANDOM for glibc PRNG seeding
On Fri, Oct 03, 2008 at 07:50:54AM -0700, Kees Cook wrote:
> @@ -152,6 +160,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
> elf_addr_t __user *sp;
> elf_addr_t __user *u_platform;
> elf_addr_t __user *u_base_platform;
> + elf_addr_t __user *u_rand_bytes;
> + unsigned int rand_size;
> const char *k_platform = ELF_PLATFORM;
> const char *k_base_platform = ELF_BASE_PLATFORM;
> int items;

Why are you introducing the rand_size variable at all? The only thing it
can cause is confuse somebody to change it, which might do bad things as
k_rand_bytes var uses ELF_AUXV_RANDOM_SIZE directly. Just use
ELF_AUXV_RANDOM_SIZE in all places you use rand_size ATM (except the
assignment and declaration of course).

Jakub


\
 
 \ /
  Last update: 2008-10-03 17:01    [W:0.200 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site