[PATCH] ELF: implement AT_RANDOM for glibc PRNG seeding

Jakub Jelinek jakub@redhat.com
Fri Oct 3 15:07:00 GMT 2008


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



More information about the Libc-alpha mailing list