Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_elf.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | SYSCTL_INT(ASLR_NODE_OID, OID_AUTO, stack_gap, CTLFLAG_RW, | ||||
__XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) | __XSTRING(__CONCAT(ELF, __ELF_WORD_SIZE)) | ||||
": maximum percentage of main stack to waste on a random gap"); | ": maximum percentage of main stack to waste on a random gap"); | ||||
static int __elfN(sigfastblock) = 1; | static int __elfN(sigfastblock) = 1; | ||||
SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, sigfastblock, | SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, sigfastblock, | ||||
CTLFLAG_RWTUN, &__elfN(sigfastblock), 0, | CTLFLAG_RWTUN, &__elfN(sigfastblock), 0, | ||||
"enable sigfastblock for new processes"); | "enable sigfastblock for new processes"); | ||||
static int __elfN(rseq1) = 1; | |||||
SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, rseq1, | |||||
CTLFLAG_RWTUN, &__elfN(rseq1), 0, | |||||
"enable rseq v1 ABI for new processes"); | |||||
static bool __elfN(allow_wx) = true; | static bool __elfN(allow_wx) = true; | ||||
SYSCTL_BOOL(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, allow_wx, | SYSCTL_BOOL(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, allow_wx, | ||||
CTLFLAG_RWTUN, &__elfN(allow_wx), 0, | CTLFLAG_RWTUN, &__elfN(allow_wx), 0, | ||||
"Allow pages to be mapped simultaneously writable and executable"); | "Allow pages to be mapped simultaneously writable and executable"); | ||||
static Elf_Brandinfo *elf_brand_list[MAX_BRANDS]; | static Elf_Brandinfo *elf_brand_list[MAX_BRANDS]; | ||||
#define aligned(a, t) (rounddown2((u_long)(a), sizeof(t)) == (u_long)(a)) | #define aligned(a, t) (rounddown2((u_long)(a), sizeof(t)) == (u_long)(a)) | ||||
▲ Show 20 Lines • Show All 1,235 Lines • ▼ Show 20 Lines | __elfN(freebsd_copyout_auxargs)(struct image_params *imgp, uintptr_t base) | ||||
} | } | ||||
AUXARGS_ENTRY(pos, AT_STACKPROT, imgp->sysent->sv_shared_page_obj | AUXARGS_ENTRY(pos, AT_STACKPROT, imgp->sysent->sv_shared_page_obj | ||||
!= NULL && imgp->stack_prot != 0 ? imgp->stack_prot : | != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : | ||||
imgp->sysent->sv_stackprot); | imgp->sysent->sv_stackprot); | ||||
if (imgp->sysent->sv_hwcap != NULL) | if (imgp->sysent->sv_hwcap != NULL) | ||||
AUXARGS_ENTRY(pos, AT_HWCAP, *imgp->sysent->sv_hwcap); | AUXARGS_ENTRY(pos, AT_HWCAP, *imgp->sysent->sv_hwcap); | ||||
if (imgp->sysent->sv_hwcap2 != NULL) | if (imgp->sysent->sv_hwcap2 != NULL) | ||||
AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2); | AUXARGS_ENTRY(pos, AT_HWCAP2, *imgp->sysent->sv_hwcap2); | ||||
AUXARGS_ENTRY(pos, AT_BSDFLAGS, __elfN(sigfastblock) ? | AUXARGS_ENTRY(pos, AT_BSDFLAGS, | ||||
ELF_BSDF_SIGFASTBLK : 0); | (__elfN(sigfastblock) ? ELF_BSDF_SIGFASTBLK : 0) | | ||||
(__elfN(rseq1) ? ELF_BSDF_RSEQ1 : 0 )); | |||||
AUXARGS_ENTRY(pos, AT_ARGC, imgp->args->argc); | AUXARGS_ENTRY(pos, AT_ARGC, imgp->args->argc); | ||||
AUXARGS_ENTRY_PTR(pos, AT_ARGV, imgp->argv); | AUXARGS_ENTRY_PTR(pos, AT_ARGV, imgp->argv); | ||||
AUXARGS_ENTRY(pos, AT_ENVC, imgp->args->envc); | AUXARGS_ENTRY(pos, AT_ENVC, imgp->args->envc); | ||||
AUXARGS_ENTRY_PTR(pos, AT_ENVV, imgp->envv); | AUXARGS_ENTRY_PTR(pos, AT_ENVV, imgp->envv); | ||||
AUXARGS_ENTRY_PTR(pos, AT_PS_STRINGS, imgp->ps_strings); | AUXARGS_ENTRY_PTR(pos, AT_PS_STRINGS, imgp->ps_strings); | ||||
if (imgp->sysent->sv_fxrng_gen_base != 0) | if (imgp->sysent->sv_fxrng_gen_base != 0) | ||||
AUXARGS_ENTRY(pos, AT_FXRNG, imgp->sysent->sv_fxrng_gen_base); | AUXARGS_ENTRY(pos, AT_FXRNG, imgp->sysent->sv_fxrng_gen_base); | ||||
if (imgp->sysent->sv_vdso_base != 0 && __elfN(vdso) != 0) | if (imgp->sysent->sv_vdso_base != 0 && __elfN(vdso) != 0) | ||||
▲ Show 20 Lines • Show All 1,303 Lines • Show Last 20 Lines |