1/* 2 * Copyright (c) 1993, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/kern/imgact_aout.c 84783 2001-10-10 23:06:54Z ps $ |
27 */ 28 29#include "opt_kstack_pages.h" 30 31#include <sys/param.h> 32#include <sys/exec.h> 33#include <sys/fcntl.h> 34#include <sys/imgact.h> --- 123 unchanged lines hidden (view full) --- 158 if (a_out->a_data + a_out->a_text > imgp->attr->va_size) 159 return (EFAULT); 160 161 /* 162 * text/data/bss must not exceed limits 163 */ 164 mtx_assert(&Giant, MA_OWNED); 165 if (/* text can't exceed maximum text size */ |
166 a_out->a_text > maxtsiz || |
167 168 /* data + bss can't exceed rlimit */ 169 a_out->a_data + bss_size > 170 imgp->proc->p_rlimit[RLIMIT_DATA].rlim_cur) 171 return (ENOMEM); 172 173 /* copy in arguments and/or environment from old process */ 174 error = exec_extract_strings(imgp); --- 113 unchanged lines hidden --- |