Deleted Added
full compact
imgact_elf.c (291597) imgact_elf.c (291937)
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 291597 2015-12-01 17:00:31Z nwhitehorn $");
32__FBSDID("$FreeBSD: head/sys/kern/imgact_elf.c 291937 2015-12-07 12:20:26Z kib $");
33
34#include "opt_capsicum.h"
35#include "opt_compat.h"
36#include "opt_gzio.h"
37
38#include <sys/param.h>
39#include <sys/capsicum.h>
40#include <sys/exec.h>

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

75#include <vm/vm_param.h>
76#include <vm/pmap.h>
77#include <vm/vm_map.h>
78#include <vm/vm_object.h>
79#include <vm/vm_extern.h>
80
81#include <machine/elf.h>
82#include <machine/md_var.h>
33
34#include "opt_capsicum.h"
35#include "opt_compat.h"
36#include "opt_gzio.h"
37
38#include <sys/param.h>
39#include <sys/capsicum.h>
40#include <sys/exec.h>

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

75#include <vm/vm_param.h>
76#include <vm/pmap.h>
77#include <vm/vm_map.h>
78#include <vm/vm_object.h>
79#include <vm/vm_extern.h>
80
81#include <machine/elf.h>
82#include <machine/md_var.h>
83#ifdef __arm__
84#include <machine/acle-compat.h>
85#endif
83
84#define ELF_NOTE_ROUNDSIZE 4
85#define OLD_EI_BRAND 8
86
87static int __elfN(check_header)(const Elf_Ehdr *hdr);
88static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp,
89 const char *interp, int interp_name_len, int32_t *osrel);
90static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr,

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

111 fallback_brand, CTLFLAG_RWTUN, &__elfN(fallback_brand), 0,
112 __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) " brand of last resort");
113
114static int elf_legacy_coredump = 0;
115SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW,
116 &elf_legacy_coredump, 0, "");
117
118int __elfN(nxstack) =
86
87#define ELF_NOTE_ROUNDSIZE 4
88#define OLD_EI_BRAND 8
89
90static int __elfN(check_header)(const Elf_Ehdr *hdr);
91static Elf_Brandinfo *__elfN(get_brandinfo)(struct image_params *imgp,
92 const char *interp, int interp_name_len, int32_t *osrel);
93static int __elfN(load_file)(struct proc *p, const char *file, u_long *addr,

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

114 fallback_brand, CTLFLAG_RWTUN, &__elfN(fallback_brand), 0,
115 __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) " brand of last resort");
116
117static int elf_legacy_coredump = 0;
118SYSCTL_INT(_debug, OID_AUTO, __elfN(legacy_coredump), CTLFLAG_RW,
119 &elf_legacy_coredump, 0, "");
120
121int __elfN(nxstack) =
119#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */
122#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \
123 (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__)
120 1;
121#else
122 0;
123#endif
124SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO,
125 nxstack, CTLFLAG_RW, &__elfN(nxstack), 0,
126 __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) ": enable non-executable stack");
127

--- 2175 unchanged lines hidden ---
124 1;
125#else
126 0;
127#endif
128SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO,
129 nxstack, CTLFLAG_RW, &__elfN(nxstack), 0,
130 __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) ": enable non-executable stack");
131

--- 2175 unchanged lines hidden ---