Deleted Added
full compact
imgact_elf.c (281848) imgact_elf.c (284665)
1/*-
2 * Copyright (c) 2000 David O'Brien
3 * Copyright (c) 1995-1996 S��ren Schmidt
4 * Copyright (c) 1996 Peter Wemm
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 David O'Brien
3 * Copyright (c) 1995-1996 S��ren Schmidt
4 * Copyright (c) 1996 Peter Wemm
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/10/sys/kern/imgact_elf.c 281848 2015-04-22 10:57:00Z kib $");
32__FBSDID("$FreeBSD: stable/10/sys/kern/imgact_elf.c 284665 2015-06-21 06:28:26Z trasz $");
33
34#include "opt_capsicum.h"
35#include "opt_compat.h"
36#include "opt_core.h"
37
38#include <sys/param.h>
39#include <sys/capsicum.h>
40#include <sys/exec.h>

--- 1185 unchanged lines hidden (view full) ---

1226 /*
1227 * Collect info about the core file header area.
1228 */
1229 hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count);
1230 __elfN(prepare_notes)(td, &notelst, &notesz);
1231 coresize = round_page(hdrsize + notesz) + seginfo.size;
1232
1233#ifdef RACCT
33
34#include "opt_capsicum.h"
35#include "opt_compat.h"
36#include "opt_core.h"
37
38#include <sys/param.h>
39#include <sys/capsicum.h>
40#include <sys/exec.h>

--- 1185 unchanged lines hidden (view full) ---

1226 /*
1227 * Collect info about the core file header area.
1228 */
1229 hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count);
1230 __elfN(prepare_notes)(td, &notelst, &notesz);
1231 coresize = round_page(hdrsize + notesz) + seginfo.size;
1232
1233#ifdef RACCT
1234 PROC_LOCK(td->td_proc);
1235 error = racct_add(td->td_proc, RACCT_CORE, coresize);
1236 PROC_UNLOCK(td->td_proc);
1237 if (error != 0) {
1238 error = EFAULT;
1239 goto done;
1234 if (racct_enable) {
1235 PROC_LOCK(td->td_proc);
1236 error = racct_add(td->td_proc, RACCT_CORE, coresize);
1237 PROC_UNLOCK(td->td_proc);
1238 if (error != 0) {
1239 error = EFAULT;
1240 goto done;
1241 }
1240 }
1241#endif
1242 if (coresize >= limit) {
1243 error = EFAULT;
1244 goto done;
1245 }
1246
1247 /*

--- 938 unchanged lines hidden ---
1242 }
1243#endif
1244 if (coresize >= limit) {
1245 error = EFAULT;
1246 goto done;
1247 }
1248
1249 /*

--- 938 unchanged lines hidden ---