Re: [PATCH] ELF: implement AT_RANDOM for glibc PRNG seeding

From: Jakub Jelinek
Date: Fri Oct 03 2008 - 10:58:54 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/