p = current->mm->arg_start; 
p = current->mm->arg_end = current->mm->arg_start; 
create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,		int interp_aout, unsigned long load_addr,		unsigned long interp_load_addr){	unsigned long p = bprm->p;	int argc = bprm->argc;	int envc = bprm->envc;	elf_addr_t __user *argv;	elf_addr_t __user *envp;	elf_addr_t __user *sp;	elf_addr_t __user *u_platform;	const char *k_platform = ELF_PLATFORM;	int items;	elf_addr_t *elf_info;	int ei_index = 0;	struct task_struct *tsk = current;	/*	 * If this architecture has a platform capability string, copy it	 * to userspace.  In some cases (Sparc), this info is impossible	 * for userspace to get any other way, in others (i386) it is	 * merely difficult.	 */	u_platform = NULL;	if (k_platform) {		size_t len = strlen(k_platform) + 1;		/*		 * In some cases (e.g. Hyper-Threading), we want to avoid L1		 * evictions by the processes running on the same package. One		 * thing we can do is to shuffle the initial stack for them.		 */	 		p = arch_align_stack(p);		u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);		if (__copy_to_user(u_platform, k_platform, len))			return -EFAULT;	}	/* Create the ELF interpreter info */	elf_info = (elf_addr_t *) current->mm->saved_auxv;#define NEW_AUX_ENT(id, val) \	do { elf_info[ei_index++] = id; elf_info[ei_index++] = val; } while (0)#ifdef ARCH_DLINFO	/* 	 * ARCH_DLINFO must come first so PPC can do its special alignment of	 * AUXV.	 */	ARCH_DLINFO;#endif	NEW_AUX_ENT(AT_HWCAP, ELF_HWCAP);	NEW_AUX_ENT(AT_PAGESZ, ELF_EXEC_PAGESIZE);	NEW_AUX_ENT(AT_CLKTCK, CLOCKS_PER_SEC);	NEW_AUX_ENT(AT_PHDR, load_addr + exec->e_phoff);	NEW_AUX_ENT(AT_PHENT, sizeof (struct elf_phdr));	NEW_AUX_ENT(AT_PHNUM, exec->e_phnum);	NEW_AUX_ENT(AT_BASE, interp_load_addr);	NEW_AUX_ENT(AT_FLAGS, 0);	NEW_AUX_ENT(AT_ENTRY, exec->e_entry);	NEW_AUX_ENT(AT_UID, (elf_addr_t) tsk->uid);	NEW_AUX_ENT(AT_EUID, (elf_addr_t) tsk->euid);	NEW_AUX_ENT(AT_GID, (elf_addr_t) tsk->gid);	NEW_AUX_ENT(AT_EGID, (elf_addr_t) tsk->egid); 	NEW_AUX_ENT(AT_SECURE, (elf_addr_t) security_bprm_secureexec(bprm));	if (k_platform) {		NEW_AUX_ENT(AT_PLATFORM, (elf_addr_t)(unsigned long)u_platform);	}	if (bprm->interp_flags & BINPRM_FLAGS_EXECFD) {		NEW_AUX_ENT(AT_EXECFD, (elf_addr_t) bprm->interp_data);	}#undef NEW_AUX_ENT	/* AT_NULL is zero; clear the rest too */	memset(&elf_info[ei_index], 0,	       sizeof current->mm->saved_auxv - ei_index * sizeof elf_info[0]);	/* And advance past the AT_NULL entry.  */	ei_index += 2;	sp = STACK_ADD(p, ei_index);	items = (argc + 1) + (envc + 1);	if (interp_aout) {		items += 3; /* a.out interpreters require argv & envp too */	} else {		items += 1; /* ELF interpreters only put argc on the stack */	}	bprm->p = STACK_ROUND(sp, items);	/* Point sp at the lowest address on the stack */#ifdef CONFIG_STACK_GROWSUP	sp = (elf_addr_t __user *)bprm->p - items - ei_index;	bprm->exec = (unsigned long) sp; /* XXX: PARISC HACK */#else	sp = (elf_addr_t __user *)bprm->p;#endif	/* Now, let's put argc (and argv, envp if appropriate) on the stack */	if (__put_user(argc, sp++))		return -EFAULT;	if (interp_aout) {		argv = sp + 2;		envp = argv + argc + 1;		__put_user((elf_addr_t)(unsigned long)argv, sp++);		__put_user((elf_addr_t)(unsigned long)envp, sp++);	} else {		argv = sp;		envp = argv + argc + 1;	}	/* Populate argv and envp */	p = current->mm->arg_start;	while (argc-- > 0) {		size_t len;		__put_user((elf_addr_t)p, argv++);		len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES);		if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)			return 0;		p += len;	}	if (__put_user(0, argv))		return -EFAULT;	current->mm->arg_end = current->mm->env_start = p;	while (envc-- > 0) {		size_t len;		__put_user((elf_addr_t)p, envp++);		len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES);		if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)			return 0;		p += len;	}	if (__put_user(0, envp))		return -EFAULT;	current->mm->env_end = p;	/* Put the elf_info on the stack in the right place.  */	sp = (elf_addr_t __user *)envp + 1;	if (copy_to_user(sp, elf_info, ei_index * sizeof(elf_addr_t)))		return -EFAULT;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a84a505956f5c795a9ab3d60d97b6b91a27aa571/binfmt_elf.c/clean/fs/binfmt_elf.c