set_mm_counter(current->mm, rss, 0);
static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs){	struct exec ex;	unsigned long error;	unsigned long fd_offset;	unsigned long rlim;	int retval;	ex = *((struct exec *) bprm->buf);		/* exec-header */	if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&	     N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) ||	    N_TRSIZE(ex) || N_DRSIZE(ex) ||	    i_size_read(bprm->file->f_dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {		return -ENOEXEC;	}	fd_offset = N_TXTOFF(ex);	/* Check initial limits. This avoids letting people circumvent	 * size limits imposed on them by creating programs with large	 * arrays in the data or bss.	 */	rlim = current->signal->rlim[RLIMIT_DATA].rlim_cur;	if (rlim >= RLIM_INFINITY)		rlim = ~0;	if (ex.a_data + ex.a_bss > rlim)		return -ENOMEM;	/* Flush all traces of the currently running executable */	retval = flush_old_exec(bprm);	if (retval)		return retval;	/* OK, This is the point of no return */#if defined(__alpha__)	SET_AOUT_PERSONALITY(bprm, ex);#elif defined(__sparc__)	set_personality(PER_SUNOS);#if !defined(__sparc_v9__)	memcpy(&current->thread.core_exec, &ex, sizeof(struct exec));#endif#else	set_personality(PER_LINUX);#endif	current->mm->end_code = ex.a_text +		(current->mm->start_code = N_TXTADDR(ex));	current->mm->end_data = ex.a_data +		(current->mm->start_data = N_DATADDR(ex));	current->mm->brk = ex.a_bss +		(current->mm->start_brk = N_BSSADDR(ex));	current->mm->free_area_cache = current->mm->mmap_base;	current->mm->cached_hole_size = 0;	set_mm_counter(current->mm, rss, 0);	current->mm->mmap = NULL;	compute_creds(bprm); 	current->flags &= ~PF_FORKNOEXEC;#ifdef __sparc__	if (N_MAGIC(ex) == NMAGIC) {		loff_t pos = fd_offset;		/* Fuck me plenty... */		/* <AOL></AOL> */		down_write(&current->mm->mmap_sem);			error = do_brk(N_TXTADDR(ex), ex.a_text);		up_write(&current->mm->mmap_sem);		bprm->file->f_op->read(bprm->file, (char *) N_TXTADDR(ex),			  ex.a_text, &pos);		down_write(&current->mm->mmap_sem);		error = do_brk(N_DATADDR(ex), ex.a_data);		up_write(&current->mm->mmap_sem);		bprm->file->f_op->read(bprm->file, (char *) N_DATADDR(ex),			  ex.a_data, &pos);		goto beyond_if;	}#endif	if (N_MAGIC(ex) == OMAGIC) {		unsigned long text_addr, map_size;		loff_t pos;		text_addr = N_TXTADDR(ex);#if defined(__alpha__) || defined(__sparc__)		pos = fd_offset;		map_size = ex.a_text+ex.a_data + PAGE_SIZE - 1;#else		pos = 32;		map_size = ex.a_text+ex.a_data;#endif		down_write(&current->mm->mmap_sem);		error = do_brk(text_addr & PAGE_MASK, map_size);		up_write(&current->mm->mmap_sem);		if (error != (text_addr & PAGE_MASK)) {			send_sig(SIGKILL, current, 0);			return error;		}		error = bprm->file->f_op->read(bprm->file,			  (char __user *)text_addr,			  ex.a_text+ex.a_data, &pos);		if ((signed long)error < 0) {			send_sig(SIGKILL, current, 0);			return error;		}			 		flush_icache_range(text_addr, text_addr+ex.a_text+ex.a_data);	} else {		static unsigned long error_time, error_time2;		if ((ex.a_text & 0xfff || ex.a_data & 0xfff) &&		    (N_MAGIC(ex) != NMAGIC) && (jiffies-error_time2) > 5*HZ)		{			printk(KERN_NOTICE "executable not page aligned\n");			error_time2 = jiffies;		}		if ((fd_offset & ~PAGE_MASK) != 0 &&		    (jiffies-error_time) > 5*HZ)		{			printk(KERN_WARNING 			       "fd_offset is not page aligned. Please convert program: %s\n",			       bprm->file->f_dentry->d_name.name);			error_time = jiffies;		}		if (!bprm->file->f_op->mmap||((fd_offset & ~PAGE_MASK) != 0)) {			loff_t pos = fd_offset;			down_write(&current->mm->mmap_sem);			do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);			up_write(&current->mm->mmap_sem);			bprm->file->f_op->read(bprm->file,					(char __user *)N_TXTADDR(ex),					ex.a_text+ex.a_data, &pos);			flush_icache_range((unsigned long) N_TXTADDR(ex),					   (unsigned long) N_TXTADDR(ex) +					   ex.a_text+ex.a_data);			goto beyond_if;		}		down_write(&current->mm->mmap_sem);		error = do_mmap(bprm->file, N_TXTADDR(ex), ex.a_text,			PROT_READ | PROT_EXEC,			MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,			fd_offset);		up_write(&current->mm->mmap_sem);		if (error != N_TXTADDR(ex)) {			send_sig(SIGKILL, current, 0);			return error;		}		down_write(&current->mm->mmap_sem); 		error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data,				PROT_READ | PROT_WRITE | PROT_EXEC,				MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,				fd_offset + ex.a_text);		up_write(&current->mm->mmap_sem);		if (error != N_DATADDR(ex)) {			send_sig(SIGKILL, current, 0);			return error;		}	}beyond_if:	set_binfmt(&aout_format);	retval = set_brk(current->mm->start_brk, current->mm->brk);	if (retval < 0) {		send_sig(SIGKILL, current, 0);		return retval;	}	retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);	if (retval < 0) { 		/* Someone check-me: is this error path enough? */ 		send_sig(SIGKILL, current, 0); 		return retval;	}	current->mm->start_stack =		(unsigned long) create_aout_tables((char __user *) bprm->p, bprm);#ifdef __alpha__	regs->gp = ex.a_gpvalue;#endif	start_thread(regs, ex.a_entry, current->mm->start_stack);	if (unlikely(current->ptrace & PT_PTRACED)) {		if (current->ptrace & PT_TRACE_EXEC)			ptrace_notify ((PTRACE_EVENT_EXEC << 8) | SIGTRAP);		else			send_sig(SIGTRAP, current, 0);	}	return 0;}