Deleted Added
full compact
imgact_elf.c (223692) imgact_elf.c (223825)
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: head/sys/kern/imgact_elf.c 223692 2011-06-30 10:56:02Z jonathan $");
32__FBSDID("$FreeBSD: head/sys/kern/imgact_elf.c 223825 2011-07-06 20:06:44Z 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/capability.h>
40#include <sys/exec.h>

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

1110 /*
1111 * Calculate the size of the core file header area by making
1112 * a dry run of generating it. Nothing is written, but the
1113 * size is calculated.
1114 */
1115 hdrsize = 0;
1116 __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count);
1117
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/capability.h>
40#include <sys/exec.h>

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

1110 /*
1111 * Calculate the size of the core file header area by making
1112 * a dry run of generating it. Nothing is written, but the
1113 * size is calculated.
1114 */
1115 hdrsize = 0;
1116 __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count);
1117
1118#ifdef RACCT
1118 PROC_LOCK(td->td_proc);
1119 error = racct_add(td->td_proc, RACCT_CORE, hdrsize + seginfo.size);
1120 PROC_UNLOCK(td->td_proc);
1121 if (error != 0) {
1122 error = EFAULT;
1123 goto done;
1124 }
1119 PROC_LOCK(td->td_proc);
1120 error = racct_add(td->td_proc, RACCT_CORE, hdrsize + seginfo.size);
1121 PROC_UNLOCK(td->td_proc);
1122 if (error != 0) {
1123 error = EFAULT;
1124 goto done;
1125 }
1126#endif
1125 if (hdrsize + seginfo.size >= limit) {
1126 error = EFAULT;
1127 goto done;
1128 }
1129
1130 /*
1131 * Allocate memory for building the header, fill it up,
1132 * and write it out.

--- 549 unchanged lines hidden ---
1127 if (hdrsize + seginfo.size >= limit) {
1128 error = EFAULT;
1129 goto done;
1130 }
1131
1132 /*
1133 * Allocate memory for building the header, fill it up,
1134 * and write it out.

--- 549 unchanged lines hidden ---